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

Update staging #1

Open
wants to merge 8 commits into
base: staging
Choose a base branch
from
Open

Update staging #1

wants to merge 8 commits into from

Conversation

afilini
Copy link

@afilini afilini commented Jul 28, 2020

No description provided.

afilini and others added 8 commits July 9, 2020 16:11
This new model is based on the idea of having only one thread monitor the socket and then
distribute the responses to every other thread that's waiting.

Whenever a request is made, a new mpsc channel is created and added to an internal map.
Then, if there are not other threads waiting for pending responses, that thread will
become the "reader thread" and monitor the socket until it receives the response it was
waiting for. In the meantime, if it sees responses coming on the socket with different
ids, it will lookup the correct Sender from the internal map and send that message to
the thread that created the request in the first place.

The other threads will be waiting trying to read from their Receiver, where they will
either get the message in response to their request, or a signal to wake up and
become the new "reader thread".
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.

2 participants