anchor.diff:      (cond ((requestp msg)
              (with-request msg
                (handler-case (send-response msg-id NIL
  -                                          (apply (gethash msg-method *request-callbacks*)
  -                                                            (first msg-params)))
  +                                          (let ((params (if (listp (first msg-params)) (first msg-params) msg-params)))
  +                                            (apply (gethash msg-method *request-callbacks*) params)))
                  (error (desc) (send-response msg-id (format nil "~A" desc) NIL)))))
             ((responsep msg)
              (with-response msg
  
positive.code:              (remhash msg-id *active-requests*)))
            ((notificationp msg)
             (with-notification msg
               (handler-case (apply (gethash msg-method *notifications-callbacks*) (first msg-params))
                 (error (desc) (warn (format nil "Unhandled notification ~A(~{~A~^, ~}):~%~A~%" msg-method (first msg-params) desc)))))))))
  
  (defun send (bytes)
    "Send bytes via *socket*."
    (if *socket*
      (if cl-async-base:*event-base*
        (as:write-socket-data *socket* bytes :force t)    
        ;; Because we can't just send message from a thread doesn't have event-loop
        ;; running and since there doesn't seem to be a better way of doing this
        ;; in cl-async, we have to make this thread know about an event loop
        ;; running in the other thread first.
        (let* ((cl-async-base:*event-base* *global-event-base*)
               (cl-async-base:*data-registry* (cl-async-base:event-base-data-registry cl-async-base:*event-base*))
               (cl-async-base:*function-registry* (cl-async-base:event-base-function-registry cl-async-base:*event-base*)))
          (as:write-socket-data *socket* bytes :force t)))))
  
  (defun run-listener (listener &rest listener-args)
    "Run event loop with specified listener and listener arguments."
  
negative.code:   "Remove a registered notification callback."
    (remhash name *notification-callbacks*))
  
  
  (defun run (&key host port filename)
    "Run listener in an event loop inside a background thread."
    (if (or host port filename)
      (bt:make-thread (lambda () (cond (filename        (run-listener #'as:pipe-connect filename))
                                       ((and host port) (run-listener #'as:tcp-connect host port))
                                       (t (error "You must specify both host and port."))))
                      :name "Event loop"
                      :initial-bindings `((mpk:*extended-types* . ',*extended-types*)))
      (with-open-file (*error-output* "/tmp/err.log" :direction :output :if-exists :append :if-does-not-exist :create)
        (run-io-listener))))
  