 ;;;; parameter should be refactored to accept a zmq-socket/SocketDescription
 ;;;; instead
 ;;;; TODO: Make that so.
-(s/defn router-recv! :- (s/maybe router-message)
+(s2/defn router-recv! :- (s2/maybe router-message)
   ([s :- mq-cmn/Socket]
    (router-recv! s :wait))
   ([s :- mq-cmn/Socket


;; Note that, in all honesty, this is pretty
;; inefficient.
(def request {:version {:major s/Int
                        :minor s/Int
                        :detail s/Int}
              :protocol s/Str
              ;; For dispatching messages that arrive on the same socket
              ;; but are really directed toward different end-points
              (s/optional-key :channel) s/Str
              :headers {(s/either s/Str s/Keyword) s/Any}
              :locator s/Str  ; think URL
              (s/optional-key :parameters) {:s/Keyword s/Any}  ; think GET
              ;; It's very tempting for the body to be just another dict like
              ;; :parameters. But it seems like we need to have some justification
              ;; for including them both.
              ;; And sticking GET params in the URL has always seemed pretty suspect
              (s/optional-key :body) s/Str})

(def router-message
  "The contents are byte-arrays? Really??

   (when-let [all-frames (read-all! s flags)]
     (extract-router-message all-frames))))

(s2/defn dealer-recv! :- s2/Any
  "Really only for the simplest possible case"
  ([s :- mq-cmn/Socket]
   (dealer-recv! s :dont-wait))
