Added back with-backplane

This commit is contained in:
Niten 2020-11-24 11:26:20 -08:00
parent 8b30811ab5
commit 665f362ce1
2 changed files with 12 additions and 6 deletions

View File

@ -127,8 +127,13 @@
:mechanism :sasl-plain)
backplane))))
;; (defmacro with-backplane (backplane &rest ops)
;; (let ((bp-sym (gensym)))
;; `(let ((,bp-sym ,backplane))
;; (unwind-protect (progn ,@ops)
;; (cl-xmpp:disconnect ,bp-sym)))))
(defmacro with-backplane (bp-clause &rest ops)
(when (or (not (listp bp-clause))
(not (= 2 (length bp-clause)))
(not (symbolp (car bp-clause))))
(error "bad backplane clause"))
(let ((bp-name (car bp-clause)))
`(let ((,bp-name ,(cadr bp-clause)))
(unwind-protect
(progn ,@ops)
(cl-xmpp:disconnect ,bp-name)))))

View File

@ -17,4 +17,5 @@
#:error-p
#:parse-message
#:handle-message
#:backplane-connect))
#:backplane-connect
#:with-backplane))