nextpyp.client.realtime.RealtimeService#

class nextpyp.client.realtime.RealtimeService#

Bases: Generic[C]

An asyncio client for NextPYP realtime web services

To connect a realtime service, create a new connection using the await with ... as ... syntax.

async with service as connection:
    pass

Once the connection is established, you can send messages to the NextPYP website and receive messages in return. look at the documentation for each realtime service individually to see what messages can be sent and received. The class named something like <service_name>RealtimeServiceConnection will have all the send and recv methods specific to that realtime service.

Methods

__init__

Details

__init__(client, endpoint, ctor)#
Parameters:
  • client (Client) –

  • endpoint (str) –

  • ctor (Callable[[WebSocketClientProtocol], C]) –

Return type:

None