Skip to main content

CloudEventsSandboxOnlyPublisher

No overview available.

Methods


Publish()

@classmethod
def Publish(
ctx: context.Context,
topic: string,
msg: proto.Message
) - > error

Publishes a CloudEvent message to a topic. This method is used to send structured event data to the sandbox environment.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the publish operation, used for cancellation and deadlines.
topicstringThe name of the topic to which the CloudEvent will be published.
msgproto.MessageThe CloudEvent message, represented as a protocol buffer message, to be published.

Returns

TypeDescription
errorAn error if the message could not be published, otherwise nil.

PublishRaw()

@classmethod
def PublishRaw(
ctx: context.Context,
topic: string,
msgRaw: []byte
) - > error

Publishes a raw byte array as a CloudEvent message to a topic. This method is useful for sending pre-serialized event data directly to the sandbox.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the publish operation, used for cancellation and deadlines.
topicstringThe name of the topic to which the raw CloudEvent will be published.
msgRaw[]byteThe raw byte array representing the CloudEvent message to be published.

Returns

TypeDescription
errorAn error if the raw message could not be published, otherwise nil.