You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The examples are used as tests to validate the fork/join pattern, but they can be made more didactic for Pony learners.
For instance, all examples output the completion of the join by writing the result in the Collectorfinish function, but frequently one will need to get that result into the actor that initiated the fork/join process. So instead of printing the output in the Collector, having the example outputting the result in Main actor would show how the result can be sent back to the initiator.
Also, inserting Debug with digestof this into the functions of the three classes *Worker, *Generator and *Collector of the examples would show the users who run those examples in debug mode how the work is split between multiple actors and get collected at the end.
The examples are used as tests to validate the fork/join pattern, but they can be made more didactic for Pony learners.
For instance, all examples output the completion of the join by writing the result in the
Collector
finish
function, but frequently one will need to get that result into the actor that initiated the fork/join process. So instead of printing the output in theCollector
, having the example outputting the result inMain
actor would show how the result can be sent back to the initiator.Also, inserting
Debug
withdigestof this
into the functions of the three classes*Worker
,*Generator
and*Collector
of the examples would show the users who run those examples in debug mode how the work is split between multiple actors and get collected at the end.Sample for
process-array.pony
Last, adding how to use the
word-count.pony
example in case of launch error is more user friendly than reporting an error:The text was updated successfully, but these errors were encountered: