Hi there,

I'd like to try some event driven programming, where a segment of code is 
set to run, but only when an "event" occurs - think like EventListeners in 
Node.js.

I think this should be pretty easy with Julia's Scheduler, and I'm 
currently going over the standard library reference documentation to see 
how this would be done. I see that notify() and conditions are rather like 
events. I suppose if you schedule a task that waits for a condition as the 
first statement then it functions like an event listener. 
I guess if you then put the code in an infinite loop with the statement to 
wait on the conditions, this would be like the event listeners that are 
fireweed repeatedly whenerve the event is fired, whereas otherwise the task 
would just be completed and removed from the scheduler when it was 
finished, and so is more like the 'once' event listeners from Node.js.

I wonder however if there is more detailed information out there on how the 
Scheduler works - for example, in the flow of a 'normal script', when 
exactly does control pass to the scheduler: I guess for @schedule, flow 
goes to the task right away, but say you had several tasks scheduled to be 
run in a script with several @schedule or @task statements - not waiting 
for a condition. Does the control go from the script to the task which 
finishes, back to the script to add the second task to the scheduler, which 
gets finished. Or once control is switched to the scheduler, does it work 
through all the tasks it has sued until they are all waiting on something, 
and then at that point control passes back to the main script? In addition, 
what variables from my script are accessible from within a task?

Thanks,
Ben.

Reply via email to