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

Reduce thread context switching in pubsub source #36

Closed
istreeter opened this issue Nov 25, 2023 · 0 comments
Closed

Reduce thread context switching in pubsub source #36

istreeter opened this issue Nov 25, 2023 · 0 comments

Comments

@istreeter
Copy link
Contributor

Previously we were running dispatcher.unsafeRunsync(io) for every single message we received from pubsub. This is a problem, because the io gets executed on the cats-effect io compute pool. So in order to just receive a message, the app needs to context switch from the subscriber thread to the cats-effect thread and back again. This is very inefficient, especially as we do it for every single event.

The solution is to stop using a Dispatcher inside the subscriber callback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant