@motiadev/core 0.5.10-beta.118 → 0.5.11-beta.120-742949
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.
|
@@ -125,6 +125,10 @@ const callStepFile = (options, motia) => {
|
|
|
125
125
|
tracer.streamOperation(name, 'getGroup', input);
|
|
126
126
|
return stateStream.getGroup(input.groupId);
|
|
127
127
|
});
|
|
128
|
+
processManager.handler(`streams.${name}.send`, async (input) => {
|
|
129
|
+
tracer.streamOperation(name, 'send', input);
|
|
130
|
+
return stateStream.send(input.channel, input.event);
|
|
131
|
+
});
|
|
128
132
|
});
|
|
129
133
|
processManager.onStdout((data) => {
|
|
130
134
|
try {
|
|
@@ -44,6 +44,7 @@ async function runTypescriptModule(filePath, event) {
|
|
|
44
44
|
set: (groupId, id, data) => sender.send(`streams.${streams.name}.set`, { groupId, id, data }),
|
|
45
45
|
delete: (groupId, id) => sender.send(`streams.${streams.name}.delete`, { groupId, id }),
|
|
46
46
|
getGroup: (groupId) => sender.send(`streams.${streams.name}.getGroup`, { groupId }),
|
|
47
|
+
send: (channel, event) => sender.send(`streams.${streams.name}.send`, { channel, event }),
|
|
47
48
|
};
|
|
48
49
|
return acc;
|
|
49
50
|
}, {});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import functools
|
|
3
3
|
import sys
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any, Dict
|
|
5
5
|
from motia_rpc import RpcSender
|
|
6
6
|
|
|
7
7
|
class RpcStreamManager:
|
|
@@ -23,6 +23,9 @@ class RpcStreamManager:
|
|
|
23
23
|
|
|
24
24
|
async def getGroup(self, group_id: str) -> asyncio.Future[None]:
|
|
25
25
|
return await self.rpc.send(f'streams.{self.stream_name}.getGroup', {'groupId': group_id})
|
|
26
|
+
|
|
27
|
+
async def send(self, channel: Dict, event: Dict) -> asyncio.Future[None]:
|
|
28
|
+
return await self.rpc.send(f'streams.{self.stream_name}.send', {'channel': channel, 'event': event})
|
|
26
29
|
|
|
27
30
|
# Add wrappers to handle non-awaited coroutines
|
|
28
31
|
def __getattribute__(self, name):
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@motiadev/core",
|
|
3
3
|
"description": "Core functionality for the Motia framework, providing the foundation for building event-driven workflows.",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
|
-
"version": "0.5.
|
|
5
|
+
"version": "0.5.11-beta.120-742949",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@amplitude/analytics-node": "^1.3.8",
|
|
8
8
|
"body-parser": "^1.20.3",
|