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

IpcOneShotServer::accept is blocking and has no non-blocking version #307

Open
pYtoner opened this issue Jan 19, 2023 · 2 comments
Open

Comments

@pYtoner
Copy link

pYtoner commented Jan 19, 2023

A non-blocking version is needed to be used in an async context.
Something like IpcOneShotServer::try_accept()

If you think this is not too difficult for someone, who is very new to this lib, to implement this then I would happily do it.

What return type would make sense?

@tevoinea
Copy link

I'd like a non-blocking accept as well. What I was thinking was:

  1. Create a try_accept in OsIpcOneShotServer that calls try_recv on the OsIpcReceiver
  2. Create try_accept in IpcOneShotServer that uses the newly created try_accept from step 1

Return types shouldn't need to change since they already return Result.

I'm also happy to open a PR for this if the maintainers will accept the contribution!

@jdm
Copy link
Member

jdm commented Feb 27, 2023

I'd review a PR that added that implementation if you verify that it works as expected!

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

No branches or pull requests

3 participants