@quenk/potoo 4.0.5 → 4.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/actor/address.js.map +1 -1
- package/lib/actor/api.d.ts +2 -2
- package/lib/actor/api.js.map +1 -1
- package/lib/actor/framework/index.js +2 -2
- package/lib/actor/framework/index.js.map +1 -1
- package/lib/actor/framework/process.d.ts +3 -2
- package/lib/actor/framework/process.js.map +1 -1
- package/lib/actor/framework/resident.d.ts +5 -3
- package/lib/actor/framework/resident.js +2 -0
- package/lib/actor/framework/resident.js.map +1 -1
- package/lib/actor/index.js.map +1 -1
- package/lib/actor/system/vm/allocator/index.js.map +1 -1
- package/lib/actor/system/vm/allocator/map.js.map +1 -1
- package/lib/actor/system/vm/conf.d.ts +5 -5
- package/lib/actor/system/vm/conf.js.map +1 -1
- package/lib/actor/system/vm/event/dispatcher.js.map +1 -1
- package/lib/actor/system/vm/event/index.js.map +1 -1
- package/lib/actor/system/vm/frame.js.map +1 -1
- package/lib/actor/system/vm/group.js.map +1 -1
- package/lib/actor/system/vm/index.d.ts +2 -2
- package/lib/actor/system/vm/index.js.map +1 -1
- package/lib/actor/system/vm/log/index.js.map +1 -1
- package/lib/actor/system/vm/log/writer.js.map +1 -1
- package/lib/actor/system/vm/object/foreign.js.map +1 -1
- package/lib/actor/system/vm/object/index.js.map +1 -1
- package/lib/actor/system/vm/object/list.js.map +1 -1
- package/lib/actor/system/vm/op/actor.js.map +1 -1
- package/lib/actor/system/vm/op/base.js.map +1 -1
- package/lib/actor/system/vm/op/index.js.map +1 -1
- package/lib/actor/system/vm/op/object.js.map +1 -1
- package/lib/actor/system/vm/registry.js.map +1 -1
- package/lib/actor/system/vm/runtime/error.js.map +1 -1
- package/lib/actor/system/vm/runtime.js.map +1 -1
- package/lib/actor/system/vm/scheduler.js.map +1 -1
- package/lib/actor/system/vm/script/index.js.map +1 -1
- package/lib/actor/system/vm/script/info.js.map +1 -1
- package/lib/actor/system/vm/strategy/error.js.map +1 -1
- package/lib/actor/system/vm/thread/factory.js.map +1 -1
- package/lib/actor/system/vm/thread/index.js.map +1 -1
- package/lib/actor/system/vm/thread/process.js.map +1 -1
- package/lib/actor/system/vm/thread/shared/index.js.map +1 -1
- package/lib/actor/system/vm/thread/shared/js.d.ts +2 -2
- package/lib/actor/system/vm/thread/shared/js.js.map +1 -1
- package/lib/actor/system/vm/type.js.map +1 -1
- package/lib/actor/template.js.map +1 -1
- package/package.json +11 -9
- package/lib/actor/address.ts +0 -90
- package/lib/actor/api.ts +0 -57
- package/lib/actor/framework/index.ts +0 -1
- package/lib/actor/framework/process.ts +0 -87
- package/lib/actor/framework/resident.ts +0 -90
- package/lib/actor/index.ts +0 -35
- package/lib/actor/system/vm/allocator/index.ts +0 -43
- package/lib/actor/system/vm/allocator/map.ts +0 -256
- package/lib/actor/system/vm/conf.ts +0 -33
- package/lib/actor/system/vm/event/dispatcher.ts +0 -85
- package/lib/actor/system/vm/event/index.ts +0 -143
- package/lib/actor/system/vm/frame.ts +0 -484
- package/lib/actor/system/vm/group.ts +0 -46
- package/lib/actor/system/vm/index.ts +0 -230
- package/lib/actor/system/vm/log/index.ts +0 -73
- package/lib/actor/system/vm/log/writer.ts +0 -96
- package/lib/actor/system/vm/object/foreign.ts +0 -10
- package/lib/actor/system/vm/object/index.ts +0 -4
- package/lib/actor/system/vm/object/list.ts +0 -8
- package/lib/actor/system/vm/op/actor.ts +0 -126
- package/lib/actor/system/vm/op/base.ts +0 -243
- package/lib/actor/system/vm/op/index.ts +0 -388
- package/lib/actor/system/vm/op/object.ts +0 -81
- package/lib/actor/system/vm/registry.ts +0 -223
- package/lib/actor/system/vm/runtime/error.ts +0 -260
- package/lib/actor/system/vm/runtime.ts +0 -31
- package/lib/actor/system/vm/scheduler.ts +0 -111
- package/lib/actor/system/vm/script/index.ts +0 -64
- package/lib/actor/system/vm/script/info.ts +0 -368
- package/lib/actor/system/vm/strategy/error.ts +0 -88
- package/lib/actor/system/vm/thread/factory.ts +0 -29
- package/lib/actor/system/vm/thread/index.ts +0 -29
- package/lib/actor/system/vm/thread/process.ts +0 -134
- package/lib/actor/system/vm/thread/shared/index.ts +0 -50
- package/lib/actor/system/vm/thread/shared/js.ts +0 -151
- package/lib/actor/system/vm/type.ts +0 -115
- package/lib/actor/template.ts +0 -170
- package/lib/tsconfig.json +0 -22
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Err } from '@quenk/noni/lib/control/error';
|
|
2
|
-
import {
|
|
2
|
+
import { Case } from '@quenk/noni/lib/control/match/case';
|
|
3
3
|
import { Template } from '../../../../template';
|
|
4
4
|
import { Address } from '../../../../address';
|
|
5
5
|
import { Message } from '../../../..';
|
|
@@ -31,5 +31,5 @@ export declare class JSThread implements SharedThread {
|
|
|
31
31
|
raise(e: Err): Promise<void>;
|
|
32
32
|
spawn(tmpl: Template): Promise<Address>;
|
|
33
33
|
tell(addr: Address, msg: Message): Promise<void>;
|
|
34
|
-
receive<T = Message>(cases?:
|
|
34
|
+
receive<T = Message>(cases?: Case<Message, T>[]): Promise<T>;
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"js.js","sourceRoot":"","sources":["js.ts"],"names":[],"mappings":";;;AACA,iEAA8D;AAC9D,sDAAmD;AACnD,6DAI4C;AAC5C,4DAAyD;AAGzD,iDAA+D;AAC/D,+CAAuC;AAGvC,wBAA8C;AAC9C,uCAAyE;AAEzE,MAAM,YAAY,GAAG,CAAC,IAAI,cAAO,CAAC,mBAAQ,CAAC,CAAC,CAAC;AAEhC,QAAA,kBAAkB,GAAG,oBAAoB,CAAC;AAEvD;;GAEG;AACH,MAAa,QAAQ;IACjB,YACW,EAAM,EACN,OAAgB,EAChB,UAAqB,EAAE,EACvB,QAAqB,cAAW,CAAC,IAAI;QAHrC,OAAE,GAAF,EAAE,CAAI;QACN,YAAO,GAAP,OAAO,CAAS;QAChB,YAAO,GAAP,OAAO,CAAgB;QACvB,UA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AO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC,CAAC;AARW,QAAA,aAAa,iBAQxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenk/potoo",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.9",
|
|
4
4
|
"description": "Message passing virtual machine.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "./node_modules/.bin/eslint src/**/*.ts test/**/*.ts",
|
|
12
|
+
"format": "./node_modules/.bin/prettier --write src test",
|
|
12
13
|
"build": "make",
|
|
13
14
|
"test": "./node_modules/.bin/jest --config jest.config.ts --runInBand test"
|
|
14
15
|
},
|
|
@@ -16,21 +17,22 @@
|
|
|
16
17
|
"@jest/globals": "^29.7.0",
|
|
17
18
|
"@quenk/test": "^2.5.0",
|
|
18
19
|
"@types/jest": "^29.5.12",
|
|
19
|
-
"@types/node": "^
|
|
20
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
21
|
-
"eslint": "^8.
|
|
22
|
-
"eslint-config-prettier": "^
|
|
23
|
-
"eslint-plugin-prettier": "^
|
|
20
|
+
"@types/node": "^22.0.2",
|
|
21
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
22
|
+
"eslint": "^9.8.0",
|
|
23
|
+
"eslint-config-prettier": "^9.1.0",
|
|
24
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
24
25
|
"jest": "^29.7.0",
|
|
25
26
|
"jest-mock-extended": "^3.0.7",
|
|
26
|
-
"prettier": "^
|
|
27
|
+
"prettier": "^3.3.3",
|
|
27
28
|
"ts-jest": "^29.1.2",
|
|
28
29
|
"ts-node": "^10.9.2",
|
|
29
|
-
"typescript": "^5.5.4"
|
|
30
|
+
"typescript": "^5.5.4",
|
|
31
|
+
"typescript-eslint": "^8.0.0"
|
|
30
32
|
},
|
|
31
33
|
"author": "Quenk Technologies Limited",
|
|
32
34
|
"license": "Apache-2.0",
|
|
33
35
|
"dependencies": {
|
|
34
|
-
"@quenk/noni": "^1.52.
|
|
36
|
+
"@quenk/noni": "^1.52.15"
|
|
35
37
|
}
|
|
36
38
|
}
|
package/lib/actor/address.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { tail } from '@quenk/noni/lib/data/array';
|
|
2
|
-
import { startsWith } from '@quenk/noni/lib/data/string';
|
|
3
|
-
|
|
4
|
-
export const SEPERATOR = '/';
|
|
5
|
-
|
|
6
|
-
export const ADDRESS_DISCARD = '?';
|
|
7
|
-
export const ADDRESS_SYSTEM = '$';
|
|
8
|
-
export const ADDRESS_EMPTY = '';
|
|
9
|
-
export const ADDRESS_RESTRICTED = [ADDRESS_DISCARD, ADDRESS_SYSTEM, SEPERATOR];
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Address of an actor.
|
|
13
|
-
*
|
|
14
|
-
* Addresses are used to properly route messages between actors in the system
|
|
15
|
-
* and conform to the path part of a URL.
|
|
16
|
-
*/
|
|
17
|
-
export type Address = string;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* AddressMap
|
|
21
|
-
*/
|
|
22
|
-
export interface AddressMap {
|
|
23
|
-
[key: string]: Address;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* isRestricted indicates whether an actor id is restricted or not.
|
|
28
|
-
*/
|
|
29
|
-
export const isRestricted = (id: string) =>
|
|
30
|
-
ADDRESS_RESTRICTED.some(a => id.indexOf(a) > -1) && id !== SEPERATOR;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* make a child address given its id and parent address.
|
|
34
|
-
*/
|
|
35
|
-
export const make = (parent: Address, id: string): Address => {
|
|
36
|
-
id = id.trim();
|
|
37
|
-
return parent === SEPERATOR || parent === ADDRESS_EMPTY
|
|
38
|
-
? `${parent}${id}`
|
|
39
|
-
: parent === ADDRESS_SYSTEM
|
|
40
|
-
? id
|
|
41
|
-
: `${parent}${SEPERATOR}${id}`;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* getParent computes the parent of an Address.
|
|
46
|
-
*/
|
|
47
|
-
export const getParent = (addr: Address): Address => {
|
|
48
|
-
if (
|
|
49
|
-
addr === ADDRESS_SYSTEM ||
|
|
50
|
-
addr === ADDRESS_EMPTY ||
|
|
51
|
-
addr === ADDRESS_DISCARD ||
|
|
52
|
-
addr === SEPERATOR
|
|
53
|
-
) {
|
|
54
|
-
return ADDRESS_SYSTEM;
|
|
55
|
-
} else {
|
|
56
|
-
let b4 = addr.split(SEPERATOR);
|
|
57
|
-
|
|
58
|
-
if (b4.length === 2 && b4[0] === '') {
|
|
59
|
-
return SEPERATOR;
|
|
60
|
-
} else {
|
|
61
|
-
let a = b4.reverse().slice(1).reverse().join(SEPERATOR);
|
|
62
|
-
|
|
63
|
-
return a === ADDRESS_EMPTY ? ADDRESS_SYSTEM : a;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* getId provides the id part of an actor address.
|
|
70
|
-
*/
|
|
71
|
-
export const getId = (addr: Address): string =>
|
|
72
|
-
addr === ADDRESS_SYSTEM ||
|
|
73
|
-
addr === ADDRESS_DISCARD ||
|
|
74
|
-
addr === ADDRESS_EMPTY ||
|
|
75
|
-
addr === SEPERATOR
|
|
76
|
-
? addr
|
|
77
|
-
: tail(addr.split(SEPERATOR));
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* isChild tests whether an address is a child of the parent address.
|
|
81
|
-
*/
|
|
82
|
-
export const isChild = (parent: Address, child: Address): boolean =>
|
|
83
|
-
(parent === ADDRESS_SYSTEM && child !== parent) ||
|
|
84
|
-
startsWith(child, `${parent}${SEPERATOR}`);
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* isGroup determines if an address is a group reference.
|
|
88
|
-
*/
|
|
89
|
-
export const isGroup = (addr: Address): boolean =>
|
|
90
|
-
addr[0] === '$' && addr !== '$';
|
package/lib/actor/api.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Err } from '@quenk/noni/lib/control/error';
|
|
2
|
-
|
|
3
|
-
import { Address } from './address';
|
|
4
|
-
import { Spawnable } from './template';
|
|
5
|
-
import { Message } from '.';
|
|
6
|
-
import { TypeCase } from '@quenk/noni/lib/control/match/case';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Parent is any object capable of spawning a child actor.
|
|
10
|
-
*/
|
|
11
|
-
export interface Parent {
|
|
12
|
-
/**
|
|
13
|
-
* spawn an actor give its template.
|
|
14
|
-
*/
|
|
15
|
-
spawn(t: Spawnable): Promise<Address>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Api is the interface provided by objects that can send/receive messages to
|
|
20
|
-
* actors within the system.
|
|
21
|
-
*
|
|
22
|
-
* This interface is separate from the Actor interface because the system is
|
|
23
|
-
* not directly concerned with their implementation. Instead, they exist to
|
|
24
|
-
* provide a way for user land code to interact with other actors within the
|
|
25
|
-
* system.
|
|
26
|
-
*/
|
|
27
|
-
export interface Api extends Parent {
|
|
28
|
-
/*
|
|
29
|
-
* self is the address for the actor within the system
|
|
30
|
-
*/
|
|
31
|
-
self: Address;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* raise an error triggering the system's error handling machinery.
|
|
35
|
-
*/
|
|
36
|
-
raise(e: Err): Promise<void>;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* kill sends a stop signal to a child actor.
|
|
40
|
-
*
|
|
41
|
-
* An actor can only specify itself or a child as the target.
|
|
42
|
-
*/
|
|
43
|
-
kill(target: Address): Promise<void>;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* tell a message to an actor address.
|
|
47
|
-
*/
|
|
48
|
-
tell(ref: string, msg: Message): Promise<void>;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* receive a message from the actor's mailbox.
|
|
52
|
-
*
|
|
53
|
-
* If TypeCases are provided, the message will be matched against them
|
|
54
|
-
* first and the result provided.
|
|
55
|
-
*/
|
|
56
|
-
receive<T>(cases?: TypeCase<T>[]): Promise<T>;
|
|
57
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { TypeCase, Case, Default } from '@quenk/noni/lib/control/match/case';
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { Type } from '@quenk/noni/lib/data/type';
|
|
2
|
-
import { empty } from '@quenk/noni/lib/data/array';
|
|
3
|
-
import {
|
|
4
|
-
CaseFunction,
|
|
5
|
-
Default,
|
|
6
|
-
TypeCase
|
|
7
|
-
} from '@quenk/noni/lib/control/match/case';
|
|
8
|
-
import { identity } from '@quenk/noni/lib/data/function';
|
|
9
|
-
|
|
10
|
-
import { Address, ADDRESS_DISCARD } from '../address';
|
|
11
|
-
import { Message } from '../';
|
|
12
|
-
|
|
13
|
-
const messages: Message[] = [];
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* init should be called as early as possible in the child process if using the
|
|
17
|
-
* direct API (Process).
|
|
18
|
-
*
|
|
19
|
-
* It sets up a listener for incoming messages to the child_process that can
|
|
20
|
-
* be read later via receive() or select().
|
|
21
|
-
*/
|
|
22
|
-
export const init = () => {
|
|
23
|
-
if (!process.send)
|
|
24
|
-
throw new Error(
|
|
25
|
-
'process: direct API is meant to ' + 'be used in a child process!'
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
process.on('message', (m: Message) => {
|
|
29
|
-
messages.unshift(m);
|
|
30
|
-
drain();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
process.on('uncaughtExceptionMonitor', err =>
|
|
34
|
-
(<Function>process.send)(err)
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* self provides the address for this child actor.
|
|
40
|
-
*/
|
|
41
|
-
export const self = process.env.POTOO_ACTOR_ADDRESS || ADDRESS_DISCARD;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* tell sends a message to another actor in the system using the VM in the
|
|
45
|
-
* parent process.
|
|
46
|
-
*/
|
|
47
|
-
export const tell = <M>(to: Address, message: M) =>
|
|
48
|
-
(<Function>process.send)({ from: self, to, message });
|
|
49
|
-
|
|
50
|
-
type Handler = (value: Type) => Promise<void>;
|
|
51
|
-
|
|
52
|
-
const receivers: Handler[] = [];
|
|
53
|
-
|
|
54
|
-
const defaultCases = [new Default(identity)];
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* receive the next message in the message queue.
|
|
58
|
-
*
|
|
59
|
-
* TODO: drop messages that do not match any cases.
|
|
60
|
-
*/
|
|
61
|
-
export const receive = async <T>(
|
|
62
|
-
cases: TypeCase<T>[] = defaultCases
|
|
63
|
-
): Promise<T> =>
|
|
64
|
-
new Promise(resolve => {
|
|
65
|
-
let matcher = new CaseFunction(cases || defaultCases);
|
|
66
|
-
let receiver = async (msg: Message) => {
|
|
67
|
-
if (matcher.test(msg)) {
|
|
68
|
-
resolve(await matcher.apply(msg));
|
|
69
|
-
} else {
|
|
70
|
-
receivers.push(receiver);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
receivers.push(receiver);
|
|
74
|
-
drain();
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
const drain = () => {
|
|
78
|
-
if (!empty(messages) && !empty(receivers))
|
|
79
|
-
(<Handler>receivers.pop())(messages.shift());
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* exit the actor, ending the process as a result.
|
|
84
|
-
*
|
|
85
|
-
* This is simply a wrapper around process.exit();
|
|
86
|
-
*/
|
|
87
|
-
export const exit = () => process.exit();
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { Err } from '@quenk/noni/lib/control/error';
|
|
2
|
-
|
|
3
|
-
import { Runtime } from '../system/vm/runtime';
|
|
4
|
-
import { Address } from '../address';
|
|
5
|
-
import { Spawnable } from '../template';
|
|
6
|
-
import { Api } from '../api';
|
|
7
|
-
import { Message, Actor } from '../';
|
|
8
|
-
import { TypeCase } from '.';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Resident is an actor that exists in the current runtime.
|
|
12
|
-
*/
|
|
13
|
-
export interface Resident extends Api, Actor {}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* AbstractResident is a base implementation of a Resident actor.
|
|
17
|
-
*/
|
|
18
|
-
export abstract class AbstractResident implements Resident {
|
|
19
|
-
constructor(public runtime: Runtime) {}
|
|
20
|
-
|
|
21
|
-
self = this.runtime.self;
|
|
22
|
-
|
|
23
|
-
async notify(msg: Message) {
|
|
24
|
-
await this.runtime.notify(msg);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
spawn(target: Spawnable) {
|
|
28
|
-
return this.runtime.spawn(target);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
async tell<M>(addr: Address, msg: M) {
|
|
32
|
-
await this.runtime.tell(addr, msg);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async raise(err: Err) {
|
|
36
|
-
await this.runtime.raise(err);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async kill(addr: Address) {
|
|
40
|
-
await this.runtime.kill(addr);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
async exit() {
|
|
44
|
-
await this.runtime.kill(this.self);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
async start() {
|
|
48
|
-
return this.run();
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async run() {}
|
|
52
|
-
|
|
53
|
-
async stop() {}
|
|
54
|
-
|
|
55
|
-
async receive<T>(cases: TypeCase<T>[]=[]) {
|
|
56
|
-
return this.runtime.receive(cases);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
watch<T>(task: () => Promise<T>) {
|
|
60
|
-
return this.runtime.watch(task);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Mutable actors can change their behaviour after message processing.
|
|
66
|
-
*/
|
|
67
|
-
export abstract class Mutable extends AbstractResident {}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Immutable is an actor whose behaviour does not change when a message is
|
|
71
|
-
* received.
|
|
72
|
-
*
|
|
73
|
-
* For each message received, the same set of TypeCase classes are applied.
|
|
74
|
-
* This class is useful for simple request/response style actors that do
|
|
75
|
-
* not require much complicated logic.
|
|
76
|
-
*/
|
|
77
|
-
export abstract class Immutable<T> extends AbstractResident {
|
|
78
|
-
/**
|
|
79
|
-
* selectors provides the list of TypeCase classes that will be applied to
|
|
80
|
-
* all incoming messages.
|
|
81
|
-
*/
|
|
82
|
-
selectors(): TypeCase<T>[] {
|
|
83
|
-
return [];
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
async start() {
|
|
87
|
-
await this.run();
|
|
88
|
-
while (this.runtime.isValid()) await this.receive(this.selectors());
|
|
89
|
-
}
|
|
90
|
-
}
|
package/lib/actor/index.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Type } from '@quenk/noni/lib/data/type';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Message is any (ideally wire-safe) value that can be sent between actors.
|
|
5
|
-
*/
|
|
6
|
-
export type Message = Type;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Actor is the main interface implemented by actors that are part of the system.
|
|
10
|
-
*/
|
|
11
|
-
export interface Actor {
|
|
12
|
-
/**
|
|
13
|
-
* start the Actor.
|
|
14
|
-
*
|
|
15
|
-
* At this point resources have been allocated within the system for the
|
|
16
|
-
* actor and it can begin sending messages.
|
|
17
|
-
*/
|
|
18
|
-
start(): Promise<void>;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* notify is called when a message is received from another actor.
|
|
22
|
-
*
|
|
23
|
-
* Some actors may process the message immediately, others may store it to
|
|
24
|
-
* a mailbox for later.
|
|
25
|
-
*/
|
|
26
|
-
notify(m: Message): Promise<void>;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* stop the Actor.
|
|
30
|
-
*
|
|
31
|
-
* A this point resources for the actor have been removed from the system
|
|
32
|
-
* and any additional clean up needed can be done.
|
|
33
|
-
*/
|
|
34
|
-
stop(): Promise<void>;
|
|
35
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Maybe } from '@quenk/noni/lib/data/maybe';
|
|
2
|
-
|
|
3
|
-
import { Address } from '../../../address';
|
|
4
|
-
import { Template } from '../../../template';
|
|
5
|
-
import { Thread } from '../thread';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Allocator is the interface the VM delegates storage of actor threads and
|
|
9
|
-
* associated information to.
|
|
10
|
-
*/
|
|
11
|
-
export interface Allocator {
|
|
12
|
-
/**
|
|
13
|
-
* getThread provides a Thread given an Address.
|
|
14
|
-
*/
|
|
15
|
-
getThread(target: Address): Maybe<Thread>;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* getThreads provides a list of Threads given a list of Addresses.
|
|
19
|
-
*/
|
|
20
|
-
getThreads(targets: Address[]): Thread[];
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* getTemplate provides a Template given an Address.
|
|
24
|
-
*/
|
|
25
|
-
getTemplate(address: Address): Maybe<Template>;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* allocate a new thread from a Template.
|
|
29
|
-
*/
|
|
30
|
-
allocate(parent: Thread, tmpl: Template): Promise<Address>;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* reallocate resources for a Thread.
|
|
34
|
-
*
|
|
35
|
-
* This essentially means the Thread has been restarted.
|
|
36
|
-
*/
|
|
37
|
-
reallocate(target: Thread): Promise<void>;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* deallocate resources for a Thread.
|
|
41
|
-
*/
|
|
42
|
-
deallocate(target: Thread): Promise<void>;
|
|
43
|
-
}
|