- (apply wait-maybe-handle-errors
- (send-message send-options from-actor
- (message-from original-message) '*reply*
- original-message #t message-body-args)
- send-options))
-
-(define (<-reply-wait from-actor original-message . message-body-args)
- "Reply to a messsage, but wait until we get a response"
- (apply <-reply-wait* '() from-actor original-message message-body-args))
+ (if (message-needs-reply? original-message)
+ (wait-maybe-handle-errors
+ (send-message '() (%current-actor)
+ (message-from original-message) '*reply*
+ original-message #t message-body-args))
+ #f))
+
+(define (<-reply-wait* send-options original-message
+ . message-body-args)
+ "Like <-reply-wait, but allows extra parameters via send-options"
+ (define* (really-send #:key (actor (%current-actor))
+ #:allow-other-keys)
+ (apply wait-maybe-handle-errors
+ (send-message send-options actor
+ (message-from original-message) '*reply*
+ original-message #t message-body-args)
+ send-options))
+ (when (message-needs-reply? original-message)
+ (apply really-send send-options)))