(nconc (proto-imported-schemas schema) (list imported)))
(return-from import-one))
(dolist (path search-path (error "Could not import ~S" import))
- (let* ((base-path (asdf:merge-pathnames* import path))
+ (let* ((base-path (asdf:merge-pathnames* import path))
(proto-file (make-pathname :name import-name :type "proto"
:defaults base-path))
(lisp-file (if output-path
:directory (pathname-directory output-path))
(make-pathname :type "lisp" :defaults base-path)))
(fasl-file (compile-file-pathname lisp-file))
- (asdf:*asdf-verbose* nil) ;; for safe-file-write-date
+ (asdf:*asdf-verbose* nil) ;for safe-file-write-date
(proto-date (asdf::safe-file-write-date proto-file))
(lisp-date (asdf::safe-file-write-date lisp-file))
(fasl-date (asdf::safe-file-write-date fasl-file)))
:documentation documentation)))
(values field cslot idx)))))))
+(defparameter *rpc-package* nil
+ "The Lisp package that implements RPC.")
+(defparameter *rpc-call-function* nil
+ "The Lisp function that implements RPC client-side calls.")
+
;; Define a service named 'type' with generic functions declared for
;; each of the methods within the service
(defmacro define-service (type (&key name options documentation)
;; asynchronous calls simpler.
(collect-form `(defgeneric ,client-fn (,vchannel ,vinput ,voutput &key ,vcallback)
,@(and documentation `((:documentation ,documentation)))
- #-sbcl (declare (values ,output-type))))
+ #-sbcl (declare (values ,output-type))
+ (:method (,vchannel (,vinput ,input-type) (,voutput ,output-type) &key ,vcallback)
+ (declare (ignorable ,vchannel ,vcallback))
+ (let ((call (and *rpc-package* *rpc-call-function*
+ (find-symbol *rpc-call-function* *rpc-package*))))
+ (assert call ()
+ "There is no RPC package loaded!")
+ (funcall call ,vchannel ',method ,vinput ,voutput
+ :callback ,vcallback)))))
;; The server side stub, e.g., 'do-read-air-reservation'.
;; The expectation is that the server-side program will implement
;; a method with the business logic for this on each kind of channel