-
Notifications
You must be signed in to change notification settings - Fork 92
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
Network wait API support #264
Network wait API support #264
Conversation
2541042
to
ed12240
Compare
ed12240
to
73281e6
Compare
73281e6
to
6ccecfa
Compare
Updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is looking pretty good to me.
There's still more to do, but I wouldn't think of these things as strictly blocking:
- The code style/indentation does not match the rest of the project. librepo seems to use 4 space indents, and spaces between identifier and parenthesis.
- I think to handle cancellation, we actually need to
g_signal_connect (cancellable, "cancelled", ...)
and break out of the mainloop too - Probably useful to think about what tests could look like for this - unit testing here is inherently hard and needs system integration testing
Now I do not have merge rights on this repository.
handle.h: function signature for lr_handle_network_wait handle.c: Added callback function required for GMainEventLoop Adds API support for waiting on network in an event driven manner: This waits for clients network interfaces till the specified time. lr_handle_network_wait(priv->repo_handle, error, timeout_seconds) This parses metalinkurl/baseurl and upon network-available signal, it polls g_network_monitor_can_reach() with the help of GMainEventLoop.
6ccecfa
to
756c246
Compare
@m-blaha Friendly Ping: Hey, when do you think this can be merged by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry for delay, the PR somehow dropped off my radar...
Thanks for your work! Just small comment - would it be possible (as a follow-up PR) to add this API also to python bindings?
Resolves #259
handle.h: added option for LRO_NETWORK_WAIT and a helper function for handling netowork wait
handle.c: Added callback function required for GMainEventLoop and functionality for option
handle-py.c: Added the case for LRO_NETWORK_WAIT
Adds API support for waiting on network:
This waits for clients network interfaces till the specified time.
lr_handle_setopt(priv->repo_handle, error, LRO_NETWORK_WAIT, seconds)
This parses metalinkurl/baseurl and polls g_network_monitor_can_reach() in an event driven
manner with the help of GMainEventLoop.