Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,13 @@ class InventoryClient(InventoryService, rpc.ClientBase):
...


async def wait_for_service(client: InventoryClient):
while client.matched_service_count == 0:
await sleep(0.1)


async def run_client(args):
participant = dds.DomainParticipant(args.domain)
client = InventoryClient(
participant, "Inventory", max_wait_per_call=dds.Duration(20)
)

# For versions 7.4.0 and below:
await wait_for_service(client)
# For newer versions you can use the following:
# await client.wait_for_service_async(dds.Duration(20))
await client.wait_for_service_async(dds.Duration(20))

print("Initial inventory: ", await client.get_inventory())

Expand Down
5 changes: 1 addition & 4 deletions tutorials/rpc/py/robot_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ async def main():
participant = dds.DomainParticipant(domain_id=0)
client = RobotControlClient(participant, "MyRobotControl")

# For versions 7.4.0 and below:
sleep(2)
# For newer versions you can use the following:
# await client.wait_for_service_async(dds.Duration(20))
await client.wait_for_service_async(dds.Duration(20)) # Available in Connext 7.5.0+

print("Calling walk_to...")
result = await client.walk_to(
Expand Down
Loading