Skip to content

boost::asio based scheduler #350

Closed Answered by victimsnino
geiseri asked this question in Q&A
Discussion options

You must be logged in to vote

About runloop_scheduler: it doesn't requires that runloop_scheduler should be static or something like this. It snake example it is global just for simplicity (prevent passing it as argument to each method). In general it works like this:

  1. you create runloop_scheduler. Scheduler owns shared_ptr to queue of schedulables
  2. when you pass scheduler to some operator (like observe_on), then it just keeps copy of this one
  3. observer_on calls create_worker during subscription for passed subscriber. At this moment we have separate and uniq worker for specific subscriber. This worker keeps weak_ptr to same queue as original scheduler
  4. any later schedulings via worker (actual scheduling of emissions) wou…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by victimsnino
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