Reuse LocalAction definition
This commit is contained in:
parent
f0c1c8665e
commit
ba2b2edfc3
4
actor.ts
4
actor.ts
|
@ -68,7 +68,7 @@ export class Turn {
|
||||||
readonly queues: Map<Actor, LocalAction[]> = new Map();
|
readonly queues: Map<Actor, LocalAction[]> = new Map();
|
||||||
readonly tasks: Array<LocalAction> = [];
|
readonly tasks: Array<LocalAction> = [];
|
||||||
|
|
||||||
static for(actor: Actor, f: (t: Turn) => void): void {
|
static for(actor: Actor, f: LocalAction): void {
|
||||||
const t = new Turn(actor);
|
const t = new Turn(actor);
|
||||||
f(t);
|
f(t);
|
||||||
t.complete();
|
t.complete();
|
||||||
|
@ -82,7 +82,7 @@ export class Turn {
|
||||||
return new Ref(this.actor, t);
|
return new Ref(this.actor, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
spawn(bootProc: (t: Turn) => void, initialAssertions = new IdentitySet<Handle>()): void {
|
spawn(bootProc: LocalAction, initialAssertions = new IdentitySet<Handle>()): void {
|
||||||
this.tasks.push(() => {
|
this.tasks.push(() => {
|
||||||
const newOutbound: OutboundMap = new Map();
|
const newOutbound: OutboundMap = new Map();
|
||||||
initialAssertions.forEach(key => {
|
initialAssertions.forEach(key => {
|
||||||
|
|
Loading…
Reference in New Issue