Static
subscribeCreates a PregelNode that subscribes to a single channel. This is used to define how nodes receive input from channels.
Single channel name to subscribe to
Optional
options: SingleChannelSubscriptionOptionsSubscription options
A PregelNode configured to receive from the specified channels
Creates a PregelNode that subscribes to multiple channels. This is used to define how nodes receive input from channels.
Optional
options: MultipleChannelSubscriptionOptionsSubscription options
A PregelNode configured to receive from the specified channels
Static
writeCreates a ChannelWrite that specifies how to write values to channels. This is used to define how nodes send output to channels.
Array of channel names to write to
Optional
writes: Record<string, unknown>Optional map of channel names to values or transformations
A ChannelWrite object that can be used to write to the specified channels
// Write to multiple channels
const write = Channel.writeTo(["output", "state"]);
// Write with specific values
const write = Channel.writeTo(["output"], {
state: "completed",
result: calculateResult()
});
// Write with a transformation function
const write = Channel.writeTo(["output"], {
result: (x) => processResult(x)
});
Utility class for working with channels in the Pregel system. Provides static methods for subscribing to channels and writing to them.
Channels are the communication pathways between nodes in a Pregel graph. They enable message passing and state updates between different parts of the graph.