Careers

Events and queues

Imagine a group of friends wanting to go for a drink. They would first need to agree that they all want to go for a drink. They would do this by subscribing for this social gathering :
Toggle
View the code
After that two people from the group want to arrange a drink night. Before doing anything they would need to do this by defining a shared resource where they would post different info about drinks they want to drink. Pictures, taste, place where they want to go to and so on.
Toggle
View the code
When some info is gathered by one of the persons, that person then sets the event in the following way :
Toggle
View the code
The other person which is currently doing something else waits until there is some event set by the first person in the following way :
Toggle
View the code
While waiting for the event, the first person can do something else besides checking the shared resource all the time to see if somebody posted something. He gets notified when this info is posted. When they finally agree on what type of drinks they want to have they can inform the other people in the group about their decision in the following way :
Toggle
View the code

Time sync for a multicall conference