method WorkersBroker.prototype.publish
WorkersBroker.prototype.publish<T>(
topic: string,
message: T
): Promise<void>

Publishes a message to a topic.

Type Parameters

The payload type

Parameters

topic: string

Destination topic

message: T

The payload, serialized as JSON by the platform

Return Type

Promise<void>

Resolves once the platform has accepted the message

Usage

import { WorkersBroker } from "cloudflare-plugin/src/index.ts";