Skip to content

Commit

Permalink
Merge pull request #145 from JanKoelzer/develop-pull-et-al
Browse files Browse the repository at this point in the history
Let dependees call callbacks
  • Loading branch information
phaller authored Jun 29, 2018
2 parents 7781d86 + a5361a8 commit 50829e9
Show file tree
Hide file tree
Showing 24 changed files with 1,244 additions and 889 deletions.
779 changes: 550 additions & 229 deletions core/src/main/scala/com/phaller/rasync/Cell.scala

Large diffs are not rendered by default.

32 changes: 27 additions & 5 deletions core/src/main/scala/com/phaller/rasync/CellCompleter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,41 @@ trait CellCompleter[K <: Key[V], V] {
/**
* The cell associated with this completer.
*/
def cell: Cell[K, V]
val cell: Cell[K, V]

private[rasync] def init: (Cell[K, V]) => Outcome[V]
/** A method to call */
private[rasync] val init: (Cell[K, V]) => Outcome[V]

/**
* Update `this` cells value with `x` and freeze it.
* The new value of `this` cell is determined by its updater.
*/
def putFinal(x: V): Unit

/**
* Update `this` cells value with `x`.
* The new value of `this` cell is determined by its updater.
*/
def putNext(x: V): Unit

/**
* Update `this` cells value with `x`. If `isFinal` is `true`, the
* cell will be frozen.
* The new value of `this` cell is determined by its updater.
*/
def put(x: V, isFinal: Boolean): Unit

private[rasync] def tryNewState(value: V): Boolean
def tryComplete(value: Try[V]): Boolean
def tryComplete(value: Try[V], dontCall: Option[Seq[Cell[K, V]]]): Boolean

private[rasync] def removeCompleteDepentCell(cell: Cell[K, V]): Unit
private[rasync] def removeNextDepentCell(cell: Cell[K, V]): Unit

private[rasync] def removeDep(cell: Cell[K, V]): Unit
private[rasync] def removeNextDep(cell: Cell[K, V]): Unit
/**
* Run code for `this` cell sequentially.
* @return The result of `f`.
*/
def sequential[T](f: => T): T
}

object CellCompleter {
Expand Down
Loading

0 comments on commit 50829e9

Please sign in to comment.