Distributed Systems, Nodejs, Node, Typescript, JavaScript.
pickedUpSignal = defineSignal('pickedUp') export async function order(productId: number): Promise<void> { // … setHandler(pickedUpSignal, () => { if (state === 'Paid') { state = 'Picked up' } }) Meanwhile, further down in the function, after the customer was charged, the function has been waiting