Skip to content
New issue

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

RpcRouter Delayed Stream Value Propagation #3702

Closed
sukazavr opened this issue Sep 30, 2024 · 4 comments · Fixed by #3710
Closed

RpcRouter Delayed Stream Value Propagation #3702

sukazavr opened this issue Sep 30, 2024 · 4 comments · Fixed by #3710
Assignees
Labels
bug Something isn't working

Comments

@sukazavr
Copy link

What version of Effect is running?

3.8.3

What steps can reproduce the bug?

  1. Set up an RpcRouter with Rpc.stream.
  2. Create a stream that emits multiple values at different intervals.
  3. Observe the timing of value propagation to the client.

Here is the reproduction of the bug: https://stackblitz.com/edit/vitejs-vite-rqzpfs?file=src%2Fserver%2Frouter.ts

What is the expected behavior?

  • Each value emitted by the stream should be instantly propagated to the client.
  • The timing between value emissions should match the intervals set in the stream.

What do you see instead?

  • The first value is emitted instantly as expected.
  • Subsequent values are delayed:
    • The second value, expected 1 second after the first, is emitted 2 seconds later.
    • The third and fourth values are emitted together, not respecting their intended intervals.
  • Values seem to wait for the next emission or the end of the stream before being propagated.

Additional information

No response

@sukazavr sukazavr added the bug Something isn't working label Sep 30, 2024
@mikearnaldi
Copy link
Member

clearly you can't get exactly the same delays as there is network in between

@mikearnaldi
Copy link
Member

That said the behaviour is odd indeed

@tim-smart
Copy link
Member

A websocket transport is planned which should solve this.

Currently streaming is done using a plain http stream, which will be likely hitting some layers of buffering.

@mikearnaldi
Copy link
Member

I changed the timeouts to be way higher and still see odd behavior, doesn't look like a buffering issue

@tim-smart tim-smart linked a pull request Oct 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants