Skip to main content

utils

Helper module for federated transport.

Classes

MessageServiceStubWrapper

class MessageServiceStubWrapper(config: MessageServiceConfig):

Wrapper around the MessageServiceStub to allow channel updates.

We need this to provide an indirection to the underlying MessageServiceStub that doesn't allow the channel to be mutated.

Constructor.

Arguments

  • channel: A grpc.Channel.

Methods


AcknowledgeMessage

async def AcknowledgeMessage(    self,    data: Acknowledgement,    /,    *,    metadata: Sequence[Tuple[str, Any]],    timeout: Optional[float] = 20.0,)> SuccessResponse:

AcknowledgeMessage GRPC Endpoint.

Diagnostics

async def Diagnostics(    self,    data: DiagnosticsParameters,    /,    *,    metadata: Sequence[Tuple[str, Any]],    timeout: Optional[float] = 20.0,)> ServiceDiagnostics:

Diagnostics GRPC Endpoint.

GetBitfountMessage

async def GetBitfountMessage(    self,    data: CommunicationDetails,    /,    *,    metadata: Sequence[Tuple[str, Any]],    timeout: Optional[float] = 20.0,)> BitfountMessage:

GetBitfountMessage GRPC Endpoint.

GetLargeObjectStorage

async def GetLargeObjectStorage(    self,    data: LargeStorageRequest,    /,    *,    metadata: Sequence[Tuple[str, Any]],    timeout: Optional[float] = 20.0,)> BlobStorageData:

GetLargeObjectStorage GRPC Endpoint.

InitiateTask

async def InitiateTask(    self,    data: BitfountTasks,    /,    *,    metadata: Sequence[Tuple[str, Any]],    timeout: Optional[float] = 20.0,)> CommunicationDetails:

InitiateTask GRPC Endpoint.

PodConnect

async def PodConnect(    self,    data: PodData,    /,    *,    metadata: Sequence[Tuple[str, Any]],    timeout: Optional[float] = 20.0,)> SuccessResponse:

PodConnect GRPC Endpoint.

SendBitfountMessage

async def SendBitfountMessage(    self,    data: BitfountMessage,    /,    *,    metadata: Sequence[Tuple[str, Any]],    timeout: Optional[float] = 20.0,)> SuccessResponse:

SendBitfountMessage GRPC Endpoint.

SetupTask

async def SetupTask(    self,    data: TaskTransferRequests,    /,    *,    metadata: Sequence[Tuple[str, Any]],    timeout: Optional[float] = 20.0,)> TaskTransferMetadata:

SetupTask GRPC Endpoint.

atomic_get_and_ack

async def atomic_get_and_ack(    self,    metadata: list[tuple[str, str]],    mailbox_id: str,    timeout: Optional[float] = None,)> BitfountMessage:

Get and acknowledge gRPC message in one atomic operation.

Will either return the retrieved and ACKed message or raise an RpcError if something goes wrong at either stage or if there is no message available.

get_channel_state

def get_channel_state(self)> grpc.ChannelConnectivity:

Get the state of the underlying GRPC channel.

reset_channel

def reset_channel(self)> None:

Reset the underlying GRPC channel.