kittycad.api.modeling.modeling_commands_ws

Functions

asyncio(fps, post_effect, show_grid, ...[, ...])

Pass those commands to the engine via websocket, and pass responses back to the client.

sync(fps, post_effect, show_grid, ...[, ...])

Pass those commands to the engine via websocket, and pass responses back to the client.

Classes

WebSocket(fps, post_effect, show_grid, ...)

A websocket connection to the API endpoint.

class kittycad.api.modeling.modeling_commands_ws.WebSocket(fps, post_effect, show_grid, unlocked_framerate, video_res_height, video_res_width, webrtc, client, pool=None, replay=None)[source][source]

A websocket connection to the API endpoint.

__annotations__ = {'ws': <class 'websockets.sync.client.ClientConnection'>}[source]
__dict__ = mappingproxy({'__module__': 'kittycad.api.modeling.modeling_commands_ws', '__annotations__': {'ws': <class 'websockets.sync.client.ClientConnection'>}, '__doc__': 'A websocket connection to the API endpoint.', '__init__': <function WebSocket.__init__>, '__enter__': <function WebSocket.__enter__>, '__exit__': <function WebSocket.__exit__>, '__iter__': <function WebSocket.__iter__>, 'send': <function WebSocket.send>, 'send_binary': <function WebSocket.send_binary>, 'recv': <function WebSocket.recv>, 'close': <function WebSocket.close>, '__dict__': <attribute '__dict__' of 'WebSocket' objects>, '__weakref__': <attribute '__weakref__' of 'WebSocket' objects>})[source]
__enter__()[source][source]
__exit__(exc_type, exc_value, traceback)[source][source]
__init__(fps, post_effect, show_grid, unlocked_framerate, video_res_height, video_res_width, webrtc, client, pool=None, replay=None)[source][source]
__iter__()[source][source]

Iterate on incoming messages.

The iterator calls recv() and yields messages in an infinite loop.

It exits when the connection is closed normally. It raises a ConnectionClosedError exception after a protocol error or a network failure.

Return type:

Iterator[RootModel[Union[SuccessWebSocketResponse, FailureWebSocketResponse]]]

__module__ = 'kittycad.api.modeling.modeling_commands_ws'[source]
close()[source][source]

Close the websocket.

recv()[source][source]

Receive data from the websocket.

Return type:

RootModel[Union[SuccessWebSocketResponse, FailureWebSocketResponse]]

send(data)[source][source]

Send data to the websocket.

send_binary(data)[source][source]

Send data as bson to the websocket.

ws: ClientConnection[source]
kittycad.api.modeling.modeling_commands_ws._get_kwargs(fps, post_effect, show_grid, unlocked_framerate, video_res_height, video_res_width, webrtc, *, client, pool=None, replay=None)[source][source]
Return type:

Dict[str, Any]

async kittycad.api.modeling.modeling_commands_ws.asyncio(fps, post_effect, show_grid, unlocked_framerate, video_res_height, video_res_width, webrtc, *, client, pool=None, replay=None)[source][source]

Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.

Return type:

ClientConnection

kittycad.api.modeling.modeling_commands_ws.sync(fps, post_effect, show_grid, unlocked_framerate, video_res_height, video_res_width, webrtc, *, client, pool=None, replay=None)[source][source]

Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.

Return type:

ClientConnection