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

timeout for wait_for_op() method; implement subscription->unsubscribe() #1

Merged
merged 2 commits into from
Jun 30, 2016

Conversation

khera
Copy link
Contributor

@khera khera commented Jun 30, 2016

The unsubscribe method is documented in the README but did not in reality exist.

The timeout in wait_for_op() is useful when doing a work loop interacting with other services.

… is documented in the README but did not exist.

Add an optional timeout to the `wait_for_op()` method.
@carwynmoore
Copy link
Owner

Thanks for the update, timeouts were really needed.

@carwynmoore carwynmoore merged commit 72acd65 into carwynmoore:master Jun 30, 2016
@khera
Copy link
Contributor Author

khera commented Jul 6, 2016

It seems that this timeout is badly implemented. In trivial case it does work, but it does get into a state where the buffered I/O from getline() has data to return already buffered, but there's no way to probe for that. The select() call just stalls waiting for more data from the network, which may never come, and the data that is in the I/O buffer never gets processed.

I'm trying to figure out a better way to do this. If all calls for I/O were via getline, then there are easy patterns to do it; however we need a mix of getline() and read(), which is making this harder, but not impossible.

I think all input will have to be done in terms of sysread with a self-managed buffer for providing the line-oriented getlnie() emulation.

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