Introduce send-feedback

This commit is contained in:
Tony Garnock-Jones 2012-07-03 15:49:58 -04:00
parent 09a957a54e
commit 90c00f7595
2 changed files with 5 additions and 2 deletions

View File

@ -67,12 +67,12 @@
;; TcpAddress TcpAddress NonNegativeInteger -> Preaction
;; Sends a credit message on a channel using the correct (subscriber) role.
(define (send-tcp-credit source-addr sink-addr amount)
(send-message (tcp-channel source-addr sink-addr (tcp-credit amount)) 'subscriber))
(send-feedback (tcp-channel source-addr sink-addr (tcp-credit amount))))
;; TcpAddress TcpAddress TcpModeName -> Preaction
;; Sends a mode selection message on a channel using the correct (subscriber) role.
(define (send-tcp-mode source-addr sink-addr mode-name)
(send-message (tcp-channel source-addr sink-addr (tcp-mode mode-name)) 'subscriber))
(send-feedback (tcp-channel source-addr sink-addr (tcp-mode mode-name))))
;; TcpAddresses; represents various wildcard addresses
(define any-remote (tcp-address (wild) (wild)))

View File

@ -41,6 +41,7 @@
(rename-out [make-delete-role delete-role])
(except-out (struct-out send-message) send-message)
(rename-out [make-send-message send-message])
send-feedback ;; TODO: maybe call this "send-reply" or "send-as-subscriber"?
(except-out (struct-out spawn) spawn)
(rename-out [make-spawn spawn])
(except-out (struct-out kill) kill)
@ -273,6 +274,8 @@
(define (make-send-message body [role 'publisher]) (send-message body role))
(define (make-kill [pid #f] #:reason [reason #f]) (kill pid reason))
(define (send-feedback body) (make-send-message body 'subscriber))
(define (make-spawn raw-spec [k #f]
#:monitor? [monitor? #f]
#:debug-name [debug-name #f]