Skip to content
Discussion options

You must be logged in to vote

Batch the data a little bit and then use defer. Defer is used in many prod apps and even if it is not ideal, it still works.

A timer is probably not a super bad idea either - even if you set it at 5ms a modern CPU that has to wake up and do nothing is still going to use practically 0% CPU-time overall because 5ms is an eternity. But this of course will drain a battery if that's something you care about. But yeah a timer is probably not my favorite solution (but it could WORK).

The ideal solution would be to not have any threading but only use 1 event loop and scale uniform instances of the entire app on isolated threads, lika NUMA-aware solutions (this is the intended architecture)

But it…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@oscarthorn
Comment options

Answer selected by oscarthorn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants