Ignore:
Timestamp:
02/22/07 22:50:56 (18 years ago)
Author:
psmith
Message:

moved threadsafe queue and added more tests.

Location:
branches/home/psmith/restructure/src/protocol/yarpc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified branches/home/psmith/restructure/src/protocol/yarpc/nio-yarpc.asd

    r40 r94  
    1111                 )
    1212
    13     :depends-on (:nio :nio-sm :nio-compat))
     13    :depends-on (:nio :nio-sm :nio-utils))
  • TabularUnified branches/home/psmith/restructure/src/protocol/yarpc/yarpc-client-state-machine.lisp

    r84 r94  
    3434;;
    3535(defclass yarpc-client-state-machine (state-machine)
    36   ((job-queue :initform (nio-compat:concurrent-queue)
     36  ((job-queue :initform (nio-utils:concurrent-queue)
    3737              :accessor job-queue
    3838              :documentation "The queue used to hand off work from an external thread to the io thread")
     
    7575(defmethod process-outgoing-packet((sm yarpc-client-state-machine))
    7676#+nio-debug  (format-log t "yarpc-client-state-machine:process-outgoing-packet called, polling the job-queue ~%")
    77   (let ((ttd (nio-compat:take (job-queue sm) :blocking-call nil)))
     77  (let ((ttd (nio-utils:take (job-queue sm) :blocking-call nil)))
    7878    (when ttd
    7979#+nio-debug      (format-log t "yarpc-client-state-machine:process-outgoing-packet got job ~A ~%" ttd)
     
    9595(defmethod remote-execute ((sm yarpc-client-state-machine) call-string callback)
    9696#+nio-debug  (format-log t "yarpc-client-state-machine:remote-execute called :sm ~A :call-string ~A :callback ~A~%" sm call-string callback)
    97   (nio-compat:add (job-queue sm) (list (remote-job callback) call-string)))
     97  (nio-utils:add (job-queue sm) (list (remote-job callback) call-string)))
  • TabularUnified branches/home/psmith/restructure/src/protocol/yarpc/yarpc-state-machine.lisp

    r93 r94  
    3535(defclass yarpc-state-machine (state-machine)
    3636  (
    37    (result-queue :initform (nio-compat:concurrent-queue)
     37   (result-queue :initform (nio-utils:concurrent-queue)
    3838                 :accessor result-queue
    3939                 :documentation "The queue used to return results from an external thread to the nio thread")))
    4040
    41 (defparameter job-queue (nio-compat:concurrent-queue)
     41(defparameter job-queue (nio-utils:concurrent-queue)
    4242  "The queue used to hand off work from the NIO thread to an external thread for execution")
    4343
     
    6161(defun run-job(&key (blocking t))
    6262#+nio-debug  (format-log t "yarpc-state-machine:run-job - Server toplevel waiting for job~%")
    63   (let ((server-job (nio-compat:take nio-yarpc:job-queue :blocking-call blocking)))
     63  (let ((server-job (nio-utils:take nio-yarpc:job-queue :blocking-call blocking)))
    6464    (when server-job
    6565      (destructuring-bind (job request-id result-queue) server-job
    6666#+nio-debug     (format-log t "yarpc-state-machine:run-job - Server received job ~A~%" job)
    67         (nio-compat:add result-queue (list request-id (nio-yarpc:execute-call job)))))))
     67        (nio-utils:add result-queue (list request-id (nio-yarpc:execute-call job)))))))
    6868
    6969
    7070(defmethod process-outgoing-packet((sm yarpc-state-machine))
    7171#+nio-debug2  (format-log t "yarpc-state-machine:process-outgoing-packet - called, polling the results-queue ~%" )
    72   (let ((server-job (nio-compat:take (result-queue sm) :blocking-call nil)))
     72  (let ((server-job (nio-utils:take (result-queue sm) :blocking-call nil)))
    7373    (when server-job
    7474      (destructuring-bind (request-id result) server-job
     
    7979(defmethod process-incoming-packet ((sm yarpc-state-machine) (call call-method-packet))
    8080#+nio-debug  (format-log t "yarpc-state-machine:process-incoming-packet - called :sm ~A :packet ~A~%" sm call)
    81   (nio-compat:add job-queue (list (call-string call) (request-id call) (result-queue sm)))
     81  (nio-utils:add job-queue (list (call-string call) (request-id call) (result-queue sm)))
    8282  (when +process-jobs-inline+ (run-job :blocking nil)))
    8383
Note: See TracChangeset for help on using the changeset viewer.