effect-actors 0.0.1
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/LICENSE +21 -0
- package/README.md +467 -0
- package/dist/actor/client.d.ts +11 -0
- package/dist/actor/client.js +68 -0
- package/dist/actor/definition.d.ts +77 -0
- package/dist/actor/definition.js +110 -0
- package/dist/actor/state/codec.d.ts +10 -0
- package/dist/actor/state/codec.js +117 -0
- package/dist/actor/state/compiled.d.ts +17 -0
- package/dist/actor/state/compiled.js +1 -0
- package/dist/actor/state/layer.d.ts +7 -0
- package/dist/actor/state/layer.js +167 -0
- package/dist/client/http/errors.d.ts +30 -0
- package/dist/client/http/errors.js +72 -0
- package/dist/client/http/events.d.ts +10 -0
- package/dist/client/http/events.js +30 -0
- package/dist/client/http/layer.d.ts +5 -0
- package/dist/client/http/layer.js +133 -0
- package/dist/client/http.d.ts +1 -0
- package/dist/client/http.js +1 -0
- package/dist/client/outcome.d.ts +4 -0
- package/dist/client/outcome.js +10 -0
- package/dist/client/service.d.ts +28 -0
- package/dist/client/service.js +4 -0
- package/dist/errors/index.d.ts +93 -0
- package/dist/errors/index.js +93 -0
- package/dist/gateway/access.d.ts +11 -0
- package/dist/gateway/access.js +38 -0
- package/dist/gateway/dispatch.d.ts +13 -0
- package/dist/gateway/dispatch.js +45 -0
- package/dist/gateway/fault.d.ts +32 -0
- package/dist/gateway/fault.js +85 -0
- package/dist/gateway/http/events.d.ts +8 -0
- package/dist/gateway/http/events.js +32 -0
- package/dist/gateway/http/response.d.ts +11 -0
- package/dist/gateway/http/response.js +57 -0
- package/dist/gateway/http/routes.d.ts +6 -0
- package/dist/gateway/http/routes.js +184 -0
- package/dist/gateway/http/validation.d.ts +19 -0
- package/dist/gateway/http/validation.js +92 -0
- package/dist/gateway/options.d.ts +31 -0
- package/dist/gateway/options.js +107 -0
- package/dist/gateway/security.d.ts +25 -0
- package/dist/gateway/security.js +4 -0
- package/dist/gateway/service.d.ts +113 -0
- package/dist/gateway/service.js +5 -0
- package/dist/gateway/websocket/operations.d.ts +20 -0
- package/dist/gateway/websocket/operations.js +96 -0
- package/dist/gateway/websocket.d.ts +8 -0
- package/dist/gateway/websocket.js +96 -0
- package/dist/gateway/wire.d.ts +172 -0
- package/dist/gateway/wire.js +102 -0
- package/dist/host/client.d.ts +9 -0
- package/dist/host/client.js +46 -0
- package/dist/host/definition.d.ts +71 -0
- package/dist/host/definition.js +68 -0
- package/dist/host/entity.d.ts +9 -0
- package/dist/host/entity.js +302 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/dist/protocol/encoding.d.ts +29 -0
- package/dist/protocol/encoding.js +165 -0
- package/dist/protocol/index.d.ts +90 -0
- package/dist/protocol/index.js +1 -0
- package/dist/protocol/schemas.d.ts +49 -0
- package/dist/protocol/schemas.js +30 -0
- package/dist/runtime/cluster/address.d.ts +3 -0
- package/dist/runtime/cluster/address.js +21 -0
- package/dist/runtime/cluster/client.d.ts +9 -0
- package/dist/runtime/cluster/client.js +131 -0
- package/dist/runtime/cluster/protocol.d.ts +104 -0
- package/dist/runtime/cluster/protocol.js +69 -0
- package/dist/runtime/configuration.d.ts +4 -0
- package/dist/runtime/configuration.js +34 -0
- package/dist/runtime/dispatchers/layer.d.ts +6 -0
- package/dist/runtime/dispatchers/layer.js +53 -0
- package/dist/runtime/dispatchers/outbox.d.ts +4 -0
- package/dist/runtime/dispatchers/outbox.js +57 -0
- package/dist/runtime/layer.d.ts +6 -0
- package/dist/runtime/layer.js +43 -0
- package/dist/runtime/service.d.ts +40 -0
- package/dist/runtime/service.js +5 -0
- package/dist/store/memory/background.d.ts +39 -0
- package/dist/store/memory/background.js +206 -0
- package/dist/store/memory/model.d.ts +72 -0
- package/dist/store/memory/model.js +149 -0
- package/dist/store/memory/ownership.d.ts +11 -0
- package/dist/store/memory/ownership.js +82 -0
- package/dist/store/memory/service.d.ts +3 -0
- package/dist/store/memory/service.js +32 -0
- package/dist/store/memory/state.d.ts +13 -0
- package/dist/store/memory/state.js +109 -0
- package/dist/store/service.d.ts +89 -0
- package/dist/store/service.js +9 -0
- package/dist/store/sql/events.d.ts +13 -0
- package/dist/store/sql/events.js +89 -0
- package/dist/store/sql/model.d.ts +39 -0
- package/dist/store/sql/model.js +126 -0
- package/dist/store/sql/outbox.d.ts +15 -0
- package/dist/store/sql/outbox.js +130 -0
- package/dist/store/sql/ownership.d.ts +44 -0
- package/dist/store/sql/ownership.js +130 -0
- package/dist/store/sql/receipts.d.ts +25 -0
- package/dist/store/sql/receipts.js +93 -0
- package/dist/store/sql/schema.d.ts +9 -0
- package/dist/store/sql/schema.js +124 -0
- package/dist/store/sql/service.d.ts +5 -0
- package/dist/store/sql/service.js +42 -0
- package/dist/store/sql/state.d.ts +13 -0
- package/dist/store/sql/state.js +109 -0
- package/dist/store/sql/timers.d.ts +10 -0
- package/dist/store/sql/timers.js +90 -0
- package/dist/store/sql/transaction.d.ts +6 -0
- package/dist/store/sql/transaction.js +57 -0
- package/dist/store/sql/transition.d.ts +15 -0
- package/dist/store/sql/transition.js +154 -0
- package/dist/testing/index.d.ts +6 -0
- package/dist/testing/index.js +27 -0
- package/package.json +80 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Layer } from "effect";
|
|
2
|
+
import { MessageStorage, RunnerHealth, Runners, RunnerStorage, Sharding, ShardingConfig, } from "effect/unstable/cluster";
|
|
3
|
+
import { layer } from "../runtime/service.js";
|
|
4
|
+
import { layerMemory as memoryStore } from "../store/service.js";
|
|
5
|
+
export const configuration = Object.freeze({
|
|
6
|
+
namespace: "test",
|
|
7
|
+
maxCommandBytes: 64 * 1024,
|
|
8
|
+
maxStateBytes: 1024 * 1024,
|
|
9
|
+
maxEventBytes: 64 * 1024,
|
|
10
|
+
maxEventsPerTurn: 128,
|
|
11
|
+
maxOutboxCallsPerTurn: 128,
|
|
12
|
+
maxTimerChangesPerTurn: 128,
|
|
13
|
+
maxTurnDuration: "5 seconds",
|
|
14
|
+
actorLeaseDuration: "30 seconds",
|
|
15
|
+
actorLeaseRenewEvery: "5 seconds",
|
|
16
|
+
});
|
|
17
|
+
const infrastructure = Sharding.layer.pipe(Layer.provideMerge(Runners.layerNoop), Layer.provideMerge(MessageStorage.layerMemory), Layer.provide([RunnerHealth.layerNoop, RunnerStorage.layerMemory]), Layer.provide(ShardingConfig.layer({
|
|
18
|
+
availableShardGroups: [configuration.namespace],
|
|
19
|
+
assignedShardGroups: [configuration.namespace],
|
|
20
|
+
shardsPerGroup: 4,
|
|
21
|
+
entityReplyPollInterval: "10 millis",
|
|
22
|
+
entityMessagePollInterval: "20 millis",
|
|
23
|
+
refreshAssignmentsInterval: "20 millis",
|
|
24
|
+
entityTerminationTimeout: "100 millis",
|
|
25
|
+
entityMaxIdleTime: "5 seconds",
|
|
26
|
+
})));
|
|
27
|
+
export const layerMemory = layer(configuration).pipe(Layer.orDie, Layer.provide(infrastructure), Layer.merge(memoryStore));
|
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "effect-actors",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Effect-native actors for durable state and hosted execution",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./Actor": {
|
|
16
|
+
"types": "./dist/actor/definition.d.ts",
|
|
17
|
+
"import": "./dist/actor/definition.js"
|
|
18
|
+
},
|
|
19
|
+
"./Store": {
|
|
20
|
+
"types": "./dist/store/service.d.ts",
|
|
21
|
+
"import": "./dist/store/service.js"
|
|
22
|
+
},
|
|
23
|
+
"./Runtime": {
|
|
24
|
+
"types": "./dist/runtime/service.d.ts",
|
|
25
|
+
"import": "./dist/runtime/service.js"
|
|
26
|
+
},
|
|
27
|
+
"./Client": {
|
|
28
|
+
"types": "./dist/client/service.d.ts",
|
|
29
|
+
"import": "./dist/client/service.js"
|
|
30
|
+
},
|
|
31
|
+
"./HostActor": {
|
|
32
|
+
"types": "./dist/host/definition.d.ts",
|
|
33
|
+
"import": "./dist/host/definition.js"
|
|
34
|
+
},
|
|
35
|
+
"./Gateway": {
|
|
36
|
+
"types": "./dist/gateway/service.d.ts",
|
|
37
|
+
"import": "./dist/gateway/service.js"
|
|
38
|
+
},
|
|
39
|
+
"./Protocol": {
|
|
40
|
+
"types": "./dist/protocol/index.d.ts",
|
|
41
|
+
"import": "./dist/protocol/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./Errors": {
|
|
44
|
+
"types": "./dist/errors/index.d.ts",
|
|
45
|
+
"import": "./dist/errors/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./Testing": {
|
|
48
|
+
"types": "./dist/testing/index.d.ts",
|
|
49
|
+
"import": "./dist/testing/index.js"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"files": [
|
|
53
|
+
"dist",
|
|
54
|
+
"README.md",
|
|
55
|
+
"LICENSE"
|
|
56
|
+
],
|
|
57
|
+
"repository": {
|
|
58
|
+
"type": "git",
|
|
59
|
+
"url": "git+https://github.com/dallenpyrah/effect-actors.git"
|
|
60
|
+
},
|
|
61
|
+
"bugs": {
|
|
62
|
+
"url": "https://github.com/dallenpyrah/effect-actors/issues"
|
|
63
|
+
},
|
|
64
|
+
"homepage": "https://github.com/dallenpyrah/effect-actors#readme",
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"access": "public"
|
|
67
|
+
},
|
|
68
|
+
"scripts": {
|
|
69
|
+
"build": "rm -rf dist && tsc --project tsconfig.build.json",
|
|
70
|
+
"lint": "prettier --check --cache --ignore-unknown --ignore-path ../../.prettierignore .",
|
|
71
|
+
"test": "bun test --timeout 30000",
|
|
72
|
+
"typecheck": "tsc --noEmit --project tsconfig.json"
|
|
73
|
+
},
|
|
74
|
+
"dependencies": {
|
|
75
|
+
"canonicalize": "2.1.0"
|
|
76
|
+
},
|
|
77
|
+
"peerDependencies": {
|
|
78
|
+
"effect": "4.0.0-rc.112"
|
|
79
|
+
}
|
|
80
|
+
}
|