diff --git a/src/courier.lisp b/src/courier.lisp index 4739467..5e70fc7 100644 --- a/src/courier.lisp +++ b/src/courier.lisp @@ -200,7 +200,8 @@ NOTES: Defines an implicit NIL block from which the user can RETURN." (assert (zerop timeout) () "Blocking RECEIVE-MESSAGE not currently supported. Consider SYNC-RECEIVE for PROCESS instances.") - (when catch-RTS? + (when (and catch-RTS? + (not (member 'message-RTS clauses :key #'car))) (setf clauses (append clauses `((message-RTS (error "Got an RTS.")))))) (a:with-gensyms (block-name inbox x) (a:once-only (address) diff --git a/src/process/dpu-helpers.lisp b/src/process/dpu-helpers.lisp index e272805..1fa5d7b 100644 --- a/src/process/dpu-helpers.lisp +++ b/src/process/dpu-helpers.lisp @@ -99,7 +99,8 @@ NOTE: `MESSAGE-RTS' replies must be explicitly handled. Otherwise, the default (multiple-value-bind (,retval ,sr-done?) ;; NOTE: this is implemented inefficiently. we could maintain an end-of-queue ;; pointer across successive unsuccessful receive attempts. - (receive-message (,sync-channel ,sync-message-place) + (receive-message (,sync-channel ,sync-message-place + :catch-rts? ,(null (member 'message-rts sync-clauses :key #'car))) ,@(loop :for (clause-head . clause-body) :in sync-clauses :collect `(,clause-head (a:when-let ((,record (process-debug? ,process-name))) diff --git a/src/process/rpc.lisp b/src/process/rpc.lisp index 96ff643..70a40de 100644 --- a/src/process/rpc.lisp +++ b/src/process/rpc.lisp @@ -54,17 +54,12 @@ If `RETURNED?' is supplied and this call generates a `MESSAGE-RTS' reply, then ` (sync-receive (,listen-channel ,message-place) ,@(unless (null returned?) `((message-RTS - ,(etypecase result-place-or-list - (symbol - `(lax-destructuring-bind - ,result-place-or-list - nil - ,@(body t))) - (list - `(lax-destructuring-bind - ,result-place-or-list - (list ,@(mapcar (constantly nil) result-place-or-list)) - ,@(body t))))))) + (lax-destructuring-bind + ,result-place-or-list + ,(etypecase result-place-or-list + (symbol 'nil) + (list `(list ,@(mapcar (constantly nil) result-place-or-list)))) + ,@(body t))))) (,message-type (lax-destructuring-bind ,result-place-or-list