We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
platform-node
3.13.8
Add serialized worker test case to:
it('Serialized 2', () => Effect.gen(function* (_) { const pool = yield* _(EffectWorker.makePoolSerialized({ size: 1 })) const people = yield* _( pool.execute(new GetPersonById({ id: 123 })), Stream.runCollect, Effect.timeout(2000), Effect.exit, ) console.log(people) const people2 = yield* _(pool.execute(new GetPersonById({ id: 123 })), Stream.take(1), Stream.runCollect) console.log(people2) // assert.deepStrictEqual(Chunk.toReadonlyArray(people), [ // new Person({ id: 123, name: "test", data: new Uint8Array([1, 2, 3]) }), // new Person({ id: 123, name: "ing", data: new Uint8Array([4, 5, 6]) }) // ]) }).pipe(Effect.scoped, Effect.provide(WorkerLive), Effect.runPromise))
And adjust serialized worker:
const WorkerLive = Runner.layerSerialized(WorkerMessage, { GetPersonById: (req) => { return Stream.make( new Person({ id: req.id, name: 'test', data: new Uint8Array([1, 2, 3]) }), new Person({ id: req.id, name: 'ing', data: new Uint8Array([4, 5, 6]) }), ).pipe(Stream.schedule(Schedule.fixed('1 second'))) },
And run 'Serialized 2 test.
'Serialized 2
This work properly for platform-browser:
But fails when running the same tests via the platform-node worker setup:
My suspicion is that the worker runner doesn't just interrupt the handler but also shutsdown the worker itself.
(Please ignore that the test output contains ChildProcessRunnerTest)
ChildProcessRunnerTest
No response
The text was updated successfully, but these errors were encountered:
Update: Seems like the current platform-node worker behaviour is "flaky" as sometimes I seem to get the expected behaviour. e.g. in this run:
But then it breaks again in the next run:
Sorry, something went wrong.
Closing this issue as a fix has been implemented 👍
Feel free to re-open or open a new issue if any additional problems persist.
Successfully merging a pull request may close this issue.
What version of Effect is running?
3.13.8
What steps can reproduce the bug?
Add serialized worker test case to:
And adjust serialized worker:
And run
'Serialized 2
test.What is the expected behavior?
This work properly for platform-browser:
What do you see instead?
But fails when running the same tests via the platform-node worker setup:
My suspicion is that the worker runner doesn't just interrupt the handler but also shutsdown the worker itself.
Additional information
(Please ignore that the test output contains
ChildProcessRunnerTest
)No response
The text was updated successfully, but these errors were encountered: