Skip to content

Broadcast message to all worker nodes while in closure of custom binary frontier operator #583

Open
@cygithub54

Description

@cygithub54

Hey, I'm new to timely and I have a question regarding broadcasting & binary frontiers. I have a custom defined binary_frontier stream operator that is in feedback with itself and runs for some arbitrary amount of iterations. Currently, the ParellizationContracts that I have passed into this operator are Exchange pacts, and route feedback messages based off an exchange ID integer defined on the message payload. However, given some condition, sometimes I want these messages to be sent to all active worker nodes. Currently I can implement this simply by checking the condition on each message, manually cloning messages intended to be global for each worker node, and then giving each copy to the session for the feedback stream. However, this feels a bit unwieldly so I was wondering if there's a way to do this a bit more idiomatically. I've looked into creating a new stream for the global messages and calling the broadcast() operator on it, but it doesn't seem like there's a way to create a new stream object within the binary frontier closure (running into lifetime issues with the required scope variable for the to_stream function). Alternatively, is there a way to get this desired global messaging behavior by modifying the passed in ParalellizationContracts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions