Closed marotili closed 8 years ago
Generally agree with this. The design philosophy has been to only use non-blocking calls generally. The one exception to this has been the use of where-is in the initialisation handler. This is an optimisation. There is in fact a timeout version of whereis, that should probably be used in this case. Then it will not block (indefinitely)
I have specifically disallowed the use of call! in agents, only cast! is used.
whereis is called on initialization of actors and the result put into the actor state for cast-calls in the message-handlers already it seems.
See https://github.com/puniverse/pulsar/issues/55 Since functions like
call!
,whereis
,sleep
or expensive functions will block the message handlers (and thus the message queue), they should not be run inside message handlers. Instead a fiber can be spawned that runs the blocking calls.