Publish To Channel • AI Agent SDK

publish_to_channel: Publish an event to all subscribers of a channel.

publish_to_channel

Async

Method

</div>

This is a method of the PushChannelProtocol class in the protocols module.

Publish an event to all subscribers of a channel.

Signature

python
async def publish_to_channel(channel_name: str, event: GatewayEvent, exclude: Optional[List[str]]) -> int

Parameters

ParamField str

Target channel

ParamField GatewayEvent

The event to deliver

ParamField Optional

Optional client IDs to skip

Returns

ResponseField int

Number of clients the event was sent to

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 1896