Skip to content

co::Coroutine -> toolbelt::Poller - #27

Open
mikael-s-persson wants to merge 4 commits into
dallison:mainfrom
mikael-s-persson:feature/poller
Open

co::Coroutine -> toolbelt::Poller#27
mikael-s-persson wants to merge 4 commits into
dallison:mainfrom
mikael-s-persson:feature/poller

Conversation

@mikael-s-persson

Copy link
Copy Markdown
Contributor

This is a refactor that's been gnawing at me for a while. It feels wrong that toolbelt would depend on coroutine, just to inject a couple of poll-like functions. So, this PR replaces the co::Coroutine* parameters in the various toolbelt classes to use its own toolbelt::Poller abstract base class, which co::Coroutine inherits from (there will be a corresponding PR in coroutines repo too).

I also add, for convenience, a PosixPoller class that implements the interface with vanilla Posix poll calls.

The motivation, other than the mere ideal of separating concerns, is to make toolbelt lighter and not joined-at-the-hip with coroutines, for when they are not used.

It creates a slightly weird situation where both repos depend on each other, but that works because only toolbelt's test targets depend on coroutines.

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

Successfully merging this pull request may close these issues.

1 participant