rename async:task to fg-task
This commit is contained in:
parent
66dcb7672a
commit
b4ee477329
2 changed files with 7 additions and 7 deletions
|
@ -79,7 +79,7 @@
|
|||
(async:start (task ctx)))
|
||||
(:method ((ctx root-service))
|
||||
(setf (task ctx)
|
||||
(async:make-task :cls 'async:task :handle-message #'handle-message))
|
||||
(async:make-task :cls 'async:fg-task :handle-message #'handle-message))
|
||||
(async:start (task ctx))))
|
||||
|
||||
(defgeneric send (rcvr msg)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
(:local-nicknames (:util :scopes/util)
|
||||
(:lp :lparallel)
|
||||
(:lpq :lparallel.queue))
|
||||
(:export #:init #:finish #:task #:bg-task
|
||||
(:export #:init #:finish #:bg-task #:fg-task
|
||||
#:make-task #:start #:stop #:status #:data #:send))
|
||||
|
||||
(in-package :scopes/util/async)
|
||||
|
@ -44,16 +44,16 @@
|
|||
(sb-sys:interactive-interrupt (condition)
|
||||
(util:lgi condition))))
|
||||
|
||||
;;;; task class and related functions / methods
|
||||
;;;; task classes and related functions / methods
|
||||
|
||||
(defclass task ()
|
||||
(defclass fg-task ()
|
||||
((job :accessor job)
|
||||
(taskid :reader taskid :initform (gensym "TSK"))
|
||||
(mailbox :accessor mailbox :initform nil)
|
||||
(status :accessor status :initform :new)
|
||||
(data :accessor data :initform nil)))
|
||||
|
||||
(defclass bg-task (task)
|
||||
(defclass bg-task (fg-task)
|
||||
((channel :reader channel :initform (lp:make-channel))))
|
||||
|
||||
(defun make-task (&key (startup #'noop) (teardown #'noop) handle-message
|
||||
|
@ -74,7 +74,7 @@
|
|||
(submit tsk))
|
||||
|
||||
(defgeneric submit (tsk)
|
||||
(:method ((tsk task))
|
||||
(:method ((tsk fg-task))
|
||||
(funcall (job tsk)))
|
||||
(:method ((tsk bg-task))
|
||||
(lp:submit-task (channel tsk) (job tsk))))
|
||||
|
@ -86,7 +86,7 @@
|
|||
(wait-result tsk)))
|
||||
|
||||
(defgeneric wait-result (tsk)
|
||||
(:method ((tsk task)))
|
||||
(:method ((tsk fg-task)))
|
||||
(:method ((tsk bg-task))
|
||||
(lp:receive-result (channel tsk))))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue