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

Refactor bridges (again) #12

Merged
merged 1 commit into from
Jun 28, 2023
Merged

Refactor bridges (again) #12

merged 1 commit into from
Jun 28, 2023

Conversation

bryanp
Copy link
Owner

@bryanp bryanp commented May 5, 2023

There's a lot to this and unfortunately it is in a single commit—it is a result of the exploration required to make this work.

Some notable changes:

  • The reactor no longer has a selector. Instead, the scheduler has an event loop for managing io select across reactors. This simplifies the reactor to only dealing with routines. IO concerns are abstracted to both the event loop and the io routine.
  • Bridges now build on top of the above to manage the existing io routine.
  • The scheduler and routine now handle wakeups with a dedicated coordinator, implemented as a thread queue. This has proven to be fairly simple to work with and avoids the race conditions that conditions can have because the signal is persisted to the queue—if the coordinator is signals before the listener subscribes the listener will still receive the signal when it gets around to listening.

@bryanp bryanp added this to the v0.3.0 milestone May 5, 2023
@bryanp bryanp changed the title Refactor bridges Refactor bridges (again) May 5, 2023
There's a lot to this and unfortunately it is in a single commit—it is a result of the exploration required to make this work.

Some notable changes:

* The reactor no longer has a selector. Instead, the scheduler has an event loop for managing io select across reactors. This simplifies the reactor to only dealing with routines. IO concerns are abstracted to both the event loop and the io routine.
* Bridges now build on top of the above to manage the existing io routine.
* The scheduler and routine now handle wakeups with a dedicated coordinator, implemented as a thread queue. This has proven to be fairly simple to work with and avoids the race conditions that conditions can have because the signal is persisted to the queue—if the coordinator is signals before the listener subscribes the listener will still receive the signal when it gets around to listening.
@bryanp bryanp merged commit 72f9bf1 into main Jun 28, 2023
4 checks passed
@bryanp bryanp deleted the chg/bridges-redux branch June 28, 2023 04:57
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