Ignore:
Timestamp:
01/19/07 02:07:22 (18 years ago)
Author:
psmith
Message:

Allowed yarpc server to do RPC calls inline if configured so

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified branches/home/psmith/restructure/src/protocol/yarpc/yarpc-state-machine.lisp

    r41 r45  
    1 #|
     1\#|
    22Copyright (c) 2007
    33All rights reserved.
     
    5353(defconstant STATE-SEND-RESPONSE 1)
    5454
     55
     56(defparameter +process-jobs-inline+ t
     57  "Set this to make the NIO thread process the RPC calls - warning the procedure should not block!")
     58
     59
     60
     61(defun run-job(&key (wait-on-job-pdw t))
     62  (format t "~A Server toplevel waiting for job~%" (nio-compat:get-readable-time))
     63  (destructuring-bind (job result-queue) (nio-compat:take nio-yarpc:job-queue :blocking-call wait-on-job-pdw)
     64    (format t "~A Server received job ~A~%" (nio-compat:get-readable-time) job)
     65    (nio-compat:add result-queue (nio-yarpc:execute-call job))))
     66
     67
    5568(defmethod process-outgoing-packet((sm yarpc-state-machine))
    5669  (format t "yarpc-state-machine: process-outgoing-packet called, polling the results-queue ~%")
     
    6477  (assert (eql (state sm) STATE-INITIALISED))
    6578  (format t "yarpc-state-machine:process-incoming-packet called :sm ~A :packet ~A~%" sm call)
    66   (nio-compat:add job-queue (list (call-string call) (result-queue sm))))
     79  (nio-compat:add job-queue (list (call-string call) (result-queue sm)))
     80  (when +process-jobs-inline+ (run-job :wait-on-job-pdw nil)))
    6781
    6882
Note: See TracChangeset for help on using the changeset viewer.