Event Types
vuer.events
¶
- vuer.events.Datetime¶
alias of
datetime
- vuer.events.Timedelta¶
alias of
timedelta
- class vuer.events.Event[source]¶
Bases:
object
An event is a message sent from the server to the client.
- ts: float¶
timestamp is a float representing the UTC datetime. Msgpack natively supports this. datetime’s Datetime class is significantly more complex as it includes timezone information.
- class vuer.events.ClientEvent[source]¶
Bases:
Event
- ts: float¶
timestamp is a float representing the UTC datetime. Msgpack natively supports this. datetime’s Datetime class is significantly more complex as it includes timezone information.
- value = None¶
- class vuer.events.InitEvent[source]¶
Bases:
ClientEvent
- ts: float¶
timestamp is a float representing the UTC datetime. Msgpack natively supports this. datetime’s Datetime class is significantly more complex as it includes timezone information.
- class vuer.events.NullEvent[source]¶
Bases:
ClientEvent
- ts: float¶
timestamp is a float representing the UTC datetime. Msgpack natively supports this. datetime’s Datetime class is significantly more complex as it includes timezone information.
- class vuer.events.ServerEvent[source]¶
Bases:
Event
- ts: float¶
timestamp is a float representing the UTC datetime. Msgpack natively supports this. datetime’s Datetime class is significantly more complex as it includes timezone information.
- class vuer.events.Noop[source]¶
Bases:
ServerEvent
- etype = 'NOOP'¶
- ts: float¶
timestamp is a float representing the UTC datetime. Msgpack natively supports this. datetime’s Datetime class is significantly more complex as it includes timezone information.
- class vuer.events.Set[source]¶
Bases:
ServerEvent
Set Operation (Server Event).
SET Operator is used exclusively to set the root Scene node. Throws an error (on the client side) if the data is not a Scene object.
- etype = 'SET'¶
The Event Type.
- ts: float¶
timestamp is a float representing the UTC datetime. Msgpack natively supports this. datetime’s Datetime class is significantly more complex as it includes timezone information.
- class vuer.events.Update[source]¶
Bases:
ServerEvent
UPDATE Operator is used to update a specific node in the scene graph.
Use “$delete” value for elements you want to remove. Or “$strict” mode to copy the element verbatim.
- Example:
app.update @ { “key”: “my_key”, “value”: “$delete” }
app.update({ “key”: “my_key”, “value”: “$delete” }, strict=True)
app.update @ [ { “key”: “my_key”, “value”: “$delete” }, … ]
app.update({ “key”: “my_key”, “value”: “$delete” }, …, strict=True)
- etype = 'UPDATE'¶
- serialize()[source]¶
Serialize the event to a dictionary for sending over the websocket. :return: A dictionary representing the event.
- ts: float¶
timestamp is a float representing the UTC datetime. Msgpack natively supports this. datetime’s Datetime class is significantly more complex as it includes timezone information.
- class vuer.events.Add[source]¶
Bases:
ServerEvent
ADD Operator is used to insert new nodes to the scene graph. By default it inserts into the root node, but you can specify a parent node to insert into via the to argument.
Note: only supports a single parent key right timestamp.
- Example:
app.add @ Element(…)
app.add @ [ Element(…), Element(…), … ]
app.add(Element, to=”my_parent_key”)
app.add([Element, …], to=”my_parent_key”)
- etype = 'ADD'¶
- serialize()[source]¶
Serialize the event to a dictionary for sending over the websocket. :return: A dictionary representing the event.
- ts: float¶
timestamp is a float representing the UTC datetime. Msgpack natively supports this. datetime’s Datetime class is significantly more complex as it includes timezone information.
- class vuer.events.Upsert[source]¶
Bases:
ServerEvent
UPSERT Operator is used to update nodes to new values, when then they do not exist, insert new ones to the scene graph.
Note: only supports a single parent key right timestamp.
- Example:
app.upsert @ Element(…)
app.upsert @ [ Element(…), Element(…), … ]
app.upsert(Element, to=”my_parent_key”)
app.upsert([Element, …], to=”my_parent_key”)
- etype = 'UPSERT'¶
- serialize()[source]¶
Serialize the event to a dictionary for sending over the websocket. :return: A dictionary representing the event.
- ts: float¶
timestamp is a float representing the UTC datetime. Msgpack natively supports this. datetime’s Datetime class is significantly more complex as it includes timezone information.
- class vuer.events.Remove[source]¶
Bases:
ServerEvent
An Update ServerEvent is sent to the client when the server wants to update the client’s state. It appends the data sent in the Update ServerEvent to the client’s current state.
- etype = 'REMOVE'¶
- ts: float¶
timestamp is a float representing the UTC datetime. Msgpack natively supports this. datetime’s Datetime class is significantly more complex as it includes timezone information.
- class vuer.events.Frame[source]¶
Bases:
ServerEvent
A higher-level ServerEvent that wraps other ServerEvents
- ServerEvent: ServerEvent¶
- etype = 'FRAME'¶
- class vuer.events.End[source]¶
Bases:
ServerEvent
A higher-level ServerEvent that wraps other ServerEvents
- etype = 'TERMINATE'¶
- ts: float¶
timestamp is a float representing the UTC datetime. Msgpack natively supports this. datetime’s Datetime class is significantly more complex as it includes timezone information.
- class vuer.events.ServerRPC[source]¶
Bases:
ServerEvent
- etype = 'RPC'¶
- rtype = 'RPC_RESPONSE@{uuid}'¶
- uuid: str¶
- class vuer.events.GrabRender[source]¶
Bases:
ServerRPC
A higher-level ServerEvent that wraps other ServerEvents
- uuid: str¶
- ts: float¶
timestamp is a float representing the UTC datetime. Msgpack natively supports this. datetime’s Datetime class is significantly more complex as it includes timezone information.
- etype = 'GRAB_RENDER'¶