Skip to content

fix(core): switch /event route to effect and implement queue#18135

Open
jlongster wants to merge 1 commit intodevfrom
jlongster/effectify-event-route
Open

fix(core): switch /event route to effect and implement queue#18135
jlongster wants to merge 1 commit intodevfrom
jlongster/effectify-event-route

Conversation

@jlongster
Copy link
Contributor

  • Moves the /event route into it's own file
  • Reimplements it with effect
  • The reason to do this is to handle event processing more explicitly. Previously, it was doing await stream.writeSSE inside of a callback to Bus.subscribeAll. The Bus abstraction allows you to do await Bus.publish and it will actually wait for all listeners to finish processing, and since a listener is writing to SSE, it will block until the event is written to SSE
  • However, that's a little strange, and is unpredictable because multiple paths could be publishing events through the bus. So it looks like it's writing events to SSE in order, but that's not actually guaranteed
  • We aren't able to actually allow waiting when publishing events anymore. With the new sync system, it will handle emitting a lot of events internally
  • We still should queue writing events to SSE. This PR does that by using effect's queue mechanism, pushing events as they come onto the queue and then sequentially processing them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant