You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finish the implementation of TimedAssistantProvider and add TimedDoerProvider and MatrixTimedDoer to support scheduling.
Also rename to third person tense the methods that return a `Duty`/`Task` and require the returned `Duty`/`Task` be triggered in order for the method's intended action to be performed.
Add the `PruebaTimed` to test the scheduling work. Curiously it had a single bug (a `wait` that had to be an `await`). I can't believe it!
Surely there are more bugs I will find later, as always.
Copy file name to clipboardExpand all lines: src/main/scala/core/Reactant.scala
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -89,13 +89,13 @@ abstract class Reactant[U](
89
89
definitialize(): doer.Duty[this.type] = { // send Started signal after all the vals and vars have been initialized
90
90
doer.checkWithin()
91
91
assert(currentBehavior ==null)
92
-
selfStart(false, initialBehaviorBuilder).map(_ => thisReactant) // TODO considerar hacer que selfStart devuelva Duty[this.type] para evitar este 'map` del final. Esto requiere que selfStop, selfRestar, stayIdleUntilNextMessageArrive, y otros que ahora devuelven Duty[Unit] también hagan lo mismo.
92
+
selfStarts(false, initialBehaviorBuilder).map(_ => thisReactant) // TODO considerar hacer que selfStarts devuelva Duty[this.type] para evitar este 'map` del final. Esto requiere que selfStop, selfRestar, stayIdleUntilNextMessageArrive, y otros que ahora devuelven Duty[Unit] también hagan lo mismo.
93
93
}
94
94
95
95
/** Starts or restarts this [[Reactant]].
96
96
* Should be called only once and within the [[doer]].
// if the `handleSignal` responds `Stop` to the `RestartReceived` signal, then the restart is canceled and the reactant is stopped instead, which provokes the signal handler be called again with a `StopReceived` signal.
Copy file name to clipboardExpand all lines: src/main/scala/core/Spawner.scala
+11-10Lines changed: 11 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -11,26 +11,27 @@ object Spawner {
11
11
}
12
12
13
13
/** A progenitor of [[Reactant]]s.
14
-
* @paramdoer the [[MatrixDoer]] within which the mutable members of this class are mutated; and the [[Doer]] that contains the [[Duty]] returned by [[createReactant]].
14
+
* @paramdoer the [[MatrixDoer]] within which the mutable members of this class are mutated; and the [[Doer]] that contains the [[Duty]] returned by [[createsReactant]].
15
15
* If this [[Spawner]] has an owner then the [[MatrixDoer]] referred by this parameter should be the same as the assigned to the `owner`.
16
16
* @paraminitialReactantSerial child reactants' serial will start at this value. Allows to distribute the load of [[MatrixDoer]] more evenly among siblings.
17
17
* @tparamMD the singleton type of the [[MatrixDoer]] assigned to the `owner`.
/** An implementation of the [[DoerProvidersManager]] trait that is [[ShutdownAble]].
14
+
* Call to methods inherited from [[ShutdownAble]] are propagated to all the [[DoerProvider]] instances managed by this instance, provided the [[DoerProvider]] are [[ShutdownAble]]. */
@@ -22,7 +24,7 @@ class CloseableDoerProvidersManager extends DoerProvidersManager, ShutdownAble {
22
24
if wasShutdown.get() thennull
23
25
else descriptor.build(this)
24
26
}).asInstanceOf[DP]
25
-
if provider ==nullthenthrownewIllegalStateException(s"A ${getTypeName[CloseableDoerProvidersManager]} instance was asked to build a new instances of ${getTypeName[DoerProvider[D]]} after it was shutdown.")
27
+
if provider ==nullthenthrownewIllegalStateException(s"A ${getTypeName[ShutdownAbleDpd]} instance was asked to build a new instances of ${getTypeName[DoerProvider[D]]} after it was shutdown.")
0 commit comments