Skip to content

pb_client.service.Service.run_program async

run_program(program, *, hub_id=None, slot=None, wait=True)

Download a program and run it.

There is no timeout argument: wrap the call in a cancel scope. Doing so also stops the program on the hub, rather than abandoning it.

Parameters:

Name Type Description Default
program bytes

The compiled program.

required
hub_id str | None

Which hub, or None for the current one.

None
slot int | None

Which program slot to use.

None
wait bool

Wait for the program to finish before returning.

True

Returns:

Type Description
str

Why the run ended: started, stopped or disconnected.