Skip to content
This repository was archived by the owner on Dec 13, 2025. It is now read-only.

Conversation

@Skylion007
Copy link

Added a feature to allow PyGazebo to wait until Gazebo starts up. This is useful if you want to say launch Gazebo and then wait for the network service to become available before proceeding with your PyGazebo code.

Added a feature to allow PyGazebo to wait until Gazebo starts up. This is useful if you want to say launch Gazebo and then wait for the network service to become available before proceeding with your PyGazebo code.
@virtuald
Copy link
Contributor

This code will block an event loop, seems like this should be implemented with trollius and set a future instead.

@Skylion007
Copy link
Author

I am little confused on how to do that. Do I just return a future true or false and put this in a coroutine?

@virtuald
Copy link
Contributor

Almost. You would return a future object, yes. And then you would do some socket operations using the async API (not using socket directly), and when the connection finally succeeds then you would set the future value to something.

@jpieper
Copy link
Owner

jpieper commented Aug 1, 2015

virtuald is correct, you'd want to use trollius/asyncio primitives to accomplish waiting. Here that would mean returning a future object which was invoked when the connection was made.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants