actors: Handle messages/coroutines in want of reply and errors.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Wed, 27 Apr 2016 22:08:34 +0000 (17:08 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 28 Apr 2016 14:18:07 +0000 (09:18 -0500)
commit413f6d981a7c4e11f2270c7bd52527d3e5a3a2c1
treecd518b6cd09d08eeccf56870dbb600646027b487
parent15d004d6a653a4302deae1a64a516b3ebb0da873
actors: Handle messages/coroutines in want of reply and errors.

If we call another method and we're "waiting" on a reply, and an error
happens in the other function so that it can't continue, that shouldn't
leave our coroutine hanging around in the waiting-coroutines hashmap
forever.  Instead, we raise it and throw an error warning about that.

(More ideally, we'd like to raise this inside of the send-message type
methods but that seems to cause a SIGABRT.  Yikes!)

* 8sync/systems/actors.scm (hive-reply-with-error): New method.
  (hive-process-message): Update call-catching-coroutine to reply with
  an eror if an uncaught exception happens.
  Update resume-waiting-coroutine to recognize whether the message
  has a '*reply* action or not.  If not, remove the coroutine (we'll
  never get a reply) and throw an error.
8sync/systems/actors.scm