sse_encode_my_notification method

  1. @protected
void sse_encode_my_notification(
  1. MyNotification self,
  2. SseSerializer serializer
)
override

Implementation

@protected
void sse_encode_my_notification(
    MyNotification self, SseSerializer serializer) {
  // Codec=Sse (Serialization based), see doc to use other codecs
  switch (self) {
    case MyNotification_Aria2(gid: final gid, event: final event):
      sse_encode_i_32(0, serializer);
      sse_encode_String(gid, serializer);
      sse_encode_my_event(event, serializer);
    case MyNotification_WebSocketConnected():
      sse_encode_i_32(1, serializer);
    case MyNotification_WebsocketClosed():
      sse_encode_i_32(2, serializer);
  }
}