!Receive Broadcast Timeout Demo

by Michael Piz

Version 1 (March 10, 2021)

Download (17 downloads)

A simple example of a receive broadcast timeout that relies on filicide/parricide to do its job.

The main fiber…

1.…forks a child fiber that waits the length of the timeout (here, 5 seconds), then…

2. …waits for a broadcast that, for demo purposes, will never arrive (in implementation, it would wait for an actual broadcast, of course), and…

3. …when "never" arrives (i.e. that actual broadcast), stops the timeout (child) fiber and confesses its murder in the log.

The child fiber…

1. …waits the length of the timeout period and…

2. …when the timeout period ends, stops the receive broadcast (parent) fiber and confesses its murder in the log.

Only one will survive! 😈 Who will it be? 🤔

5.0 average rating from 1 reviews

5 stars
1
4 stars
0
3 stars
0
2 stars
0
1 star
0
Reports
0

Rate and review within the app in the Community section.