Keeping an event aside and fire it when another event comes in

Hey hey good evening,

I’m trying to do the following : I have an event A that will fire at some point, but I want to hold it until another event B fires.

Idea is that my application will receive some notification from the outside telling it to do something, but I need to delay that something until another event, internal to my application, allows that something to happen.

I have found a solution looking at some C# stuff online and came up with the following weird patch. It does what I want, but it looks.. funny.

Here’s a patch and a video recording. Is there something

DelayEventUntilAnotherEventHappens.vl (13.1 KB)

Does anyone have something more straightforward to suggest?

Thanks!

So, rather than trying to understand Reactive events I have never used, I tried to patch the thing manually and came up with this DelayUntilOnce node. Difference with the previous setup is that it allows the event to be re-emitted only once, which I needed for my use case.

I did it with a SpreadBuilder but I guess there are better structures like Queues to do those things.

If someone knows a thing that already does that off the shelf please let me know :-)

DelayUntilOnce.vl (30.2 KB)

DelayEventUntilAnotherEventHappens_answer1.vl (16.3 KB)

The main problem is that it is necessary to manage the state.

DelayEventUntilAnotherEventHappens_answer2.vl (26.5 KB)

In the case of Zip, there will be a buffer, and the event will be saved as many times as it is called, and each call on the right will retrieve from this buffer.

2 Likes

Thanks for those @yar!

Still a bit lost with all these Reactive operators. I indeed have to manage a state since the event should be allowed to fire just once, which I did in my previous post with a SpreadBuilder. Maybe not super elegant, but works :)

@sebescudie Actually, that’s how it should be done.

DelayEventUntilAnotherEventHappens_answer3-Application_2025.11.21-10.18.02

Observables should have a WithLatesFrom function, which should essentially allow you to continuously receive the latest value from stream A through events in stream B. But I don’t see it in the VVVV API. But maybe it’s just CombineLatest node

1 Like

DelayEventUntilAnotherEventHappens_answer3-Application_2025.11.21-10.32.16

1 Like

Looks like Sample is what I was after, thanks!

WithLatestFrom will work before combine latest, e.g. on inputs of CombineLetest e.g. you need to connect WithLatestFrom before combine latest