Skip to content

server ¤

DispatchServer ¤

DispatchServer(
    service: DispatchServiceServicer,
    hostname: str = "127.0.0.1",
    port: int = 0,
)

Test server for a Dispatch service. This is useful for testing a mock version of Dispatch locally (e.g. see dispatch.test.DispatchService).

Parameters:

Name Type Description Default
service DispatchServiceServicer

Dispatch service to serve.

required
hostname str

Hostname to bind to.

'127.0.0.1'
port int

Port to bind to, or 0 to bind to any available port.

0

url property ¤

url

Returns the URL of the server.

start ¤

start()

Start the server.

stop ¤

stop()

Stop the server.