From b4ee477329a93d7a7fe810500769c7ef27e43900 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Sat, 12 Apr 2025 10:46:26 +0200 Subject: [PATCH] rename async:task to fg-task --- core/core.lisp | 2 +- util/async.lisp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/core.lisp b/core/core.lisp index 13458af..094c247 100644 --- a/core/core.lisp +++ b/core/core.lisp @@ -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) diff --git a/util/async.lisp b/util/async.lisp index 8d7dd67..3caa44c 100644 --- a/util/async.lisp +++ b/util/async.lisp @@ -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))))