Skip to main content

message_service

Interface classes and methods for the message service.

Provides functionality to wrap generated GRPC code and python-friendly versions of GRPC classes and methods.

Module

Functions

message_metadata_from_grpc_2_sdk

def message_metadata_from_grpc_2_sdk(    grpc_message_metadata: GrpcMessageMetadata,)> bitfount.federated.transport.message_service._MessageMetadata:

Deserialise message metadata.

message_metadata_from_sdk_2_grpc

def message_metadata_from_sdk_2_grpc(    message_metadata: _MessageMetadata,)> MessageMetadata:

Serialise message metadata.

msgpackext_decode

def msgpackext_decode(code: int, obj: Any)> Any:

Extension to deserialise DataFrame and numpy using arrow.

Arguments

  • code: An integer specifying whether the object is a numpy array (code=1) or Dataframe (code=2).
  • obj: An encoded object, likely a dictionary.

Returns The decoded form of the object.

msgpackext_encode

def msgpackext_encode(obj: Any)> Any:

Serialises extension objects for DataFrames or np.ndarray using pyarrow.

Arguments

  • obj: An object to be serialized

Returns A msgpack compatible extension form of the object.

Classes

Reason

class Reason(value, names=None, *, module=None, qualname=None, type=None, start=1):

Machine-readable reason for the message to have been triggered.

Ancestors

Variables

  • static MODELLER_TIMEOUT
  • static NO_NEW_DATA
  • static WORKER_ERROR

TaskNotification

class TaskNotification(message: str, email: bool):

User-readable notification that should be triggered by this message.

Variables

  • static email : bool
  • static message : str