nextpyp.client.gen.ProjectRealtimeServiceConnection#
- class nextpyp.client.gen.ProjectRealtimeServiceConnection#
Bases:
RealtimeServiceConnection(no description yet)
- Permission Needed:
project_listen- Client to Server messages:
- Server to Client messages:
Methods
Receives a message from the website.
Sends a RealTimeC2SListenToProject message
Details
- __init__(websocket)#
- Parameters:
websocket (WebSocketClientProtocol) –
- Return type:
None
- async recv()#
Receives a message from the website. Could be any one of several different messages.
- Return type:
Union[RealTimeS2CProjectStatus,RealTimeS2CProjectRunInit,RealTimeS2CProjectRunStart,RealTimeS2CJobStart,RealTimeS2CJobUpdate,RealTimeS2CJobFinish,RealTimeS2CProjectRunFinish,RealTimeS2CClusterJobSubmit,RealTimeS2CClusterJobStart,RealTimeS2CClusterJobArrayStart,RealTimeS2CClusterJobArrayEnd,RealTimeS2CClusterJobEnd]
Examples
Receive a message from this realtime service:
msg = await project.recv() if type(msg) is RealTimeS2CProjectStatus: print(f'received message: {msg}') elif type(msg) is RealTimeS2CProjectRunInit: print(f'received message: {msg}') elif type(msg) is RealTimeS2CProjectRunStart: print(f'received message: {msg}') elif type(msg) is RealTimeS2CJobStart: print(f'received message: {msg}') elif type(msg) is RealTimeS2CJobUpdate: print(f'received message: {msg}') elif type(msg) is RealTimeS2CJobFinish: print(f'received message: {msg}') elif type(msg) is RealTimeS2CProjectRunFinish: print(f'received message: {msg}') elif type(msg) is RealTimeS2CClusterJobSubmit: print(f'received message: {msg}') elif type(msg) is RealTimeS2CClusterJobStart: print(f'received message: {msg}') elif type(msg) is RealTimeS2CClusterJobArrayStart: print(f'received message: {msg}') elif type(msg) is RealTimeS2CClusterJobArrayEnd: print(f'received message: {msg}') elif type(msg) is RealTimeS2CClusterJobEnd: print(f'received message: {msg}') else: raise Exception(f'received unexpected msg: {msg}')
- async send_listen_to_project(msg)#
Sends a RealTimeC2SListenToProject message
- Return type:
None- Parameters:
msg (RealTimeC2SListenToProject) –