调度¶
调度模型与背压策略。worker:mode 选择执行模型,worker:runPolicy 设置池的背压。
zoo_framework.core.waiter.base_waiter.BaseWaiter ¶
The base waiter (scheduler).
属性:
| 名称 | 类型 | 描述 |
|---|---|---|
worker_mode |
the effective scheduling model name |
|
pool_enable |
whether a resource pool is in use (derived from the model name) |
|
model |
SchedulerModel
|
the assembled scheduling model |
core |
the dispatch core |
源代码位于: zoo_framework/core/waiter/base_waiter.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | |
validate_worker_mode
staticmethod
¶
Check whether the dispatch mode is implemented.
Unimplemented modes MUST be rejected explicitly and MUST NOT silently execute as some other mode.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
mode
|
str
|
the dispatch mode name |
必需 |
返回:
| 类型 | 描述 |
|---|---|
str
|
The validated mode name |
引发:
| 类型 | 描述 |
|---|---|
NotImplementedError
|
the mode is not implemented |
源代码位于: zoo_framework/core/waiter/base_waiter.py
get_worker_mode ¶
Get the Worker's mode.
An explicitly configured worker:mode takes precedence; when unset it
is derived from worker:pool:enable. Unimplemented modes are
rejected explicitly.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
pool_enable
|
bool
|
the pool switch |
必需 |
返回:
| 类型 | 描述 |
|---|---|
tuple[str, bool]
|
(mode name, whether a pool is used) |
源代码位于: zoo_framework/core/waiter/base_waiter.py
register_handler ¶
Register the handler.
Binds the result reactor to the unified result topic.
bind_topic_reactor is idempotent, so constructing the scheduler
repeatedly does not pile up duplicate reactors under the topic.
源代码位于: zoo_framework/core/waiter/base_waiter.py
call_workers ¶
Muster the workers and start the model container honoring the backpressure policy.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
worker_list
|
list
|
the Workers participating in scheduling |
必需 |
源代码位于: zoo_framework/core/waiter/base_waiter.py
add_worker ¶
Admit a Worker newly registered at runtime into scheduling.
The scheduling list is owned by the scheduler; being listed in a registry alone is not enough for the Worker to be dispatched.
Runtime admission goes through the same capacity admission as the
startup muster (call_workers -> model.prepare_workers): the
prospective scheduling list is handed to the model first, so the
backpressure policy governs runtime registration too (issue #233). A
rejected Worker - the reject policy with an over-capacity count -
MUST raise and MUST NOT be silently added to the scheduling list.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
worker
|
BaseWorker
|
the Worker to add to scheduling |
必需 |
引发:
| 类型 | 描述 |
|---|---|
ValueError
|
the backpressure policy rejects the prospective worker set |
源代码位于: zoo_framework/core/waiter/base_waiter.py
execute_service ¶
Execute one service round.
Only Workers declared looping and not circuit-broken remain in the scheduling list after this round.
源代码位于: zoo_framework/core/waiter/base_waiter.py
shutdown ¶
Shutdown: stop dispatching and let the model reclaim the container.
MUST be repeatable.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
wait
|
bool
|
whether to wait for in-flight tasks to finish |
True
|
timeout
|
float | None
|
the waiting bound in seconds; None means unbounded |
None
|
源代码位于: zoo_framework/core/waiter/base_waiter.py
调度模型¶
zoo_framework.core.waiter.scheduler_model ¶
Scheduling models: declare contracts and own the concurrency primitive and round shape.
The six contract items MUST be programmatically queryable (describe()):
- concurrency primitive
concurrency_primitive - supported time semantics
supported_time_semantics - backpressure policy
backpressure_policy - stop semantics
stop_semantics - supported Worker kinds
supported_worker_kinds - observable metrics
observable_metrics
"Supported time semantics" declares which time semantics this model can
schedule, and MUST NOT be read as pinning the whole process to one semantics:
period and phase are declared per Worker, and one model MUST be able to
schedule periodic-driven and event-driven Workers at the same time (a device
scenario with periodic control loops coexisting with event-driven alarm
handlers is exactly that). Period scheduling itself is independent of the
concurrency primitive; it is owned by
:class:~zoo_framework.core.waiter.dispatch_core.WorkerDispatchCore.
A model is only responsible for "how to send Workers out and how to reclaim the concurrency container". Any model-agnostic correctness logic - the single settlement path, timeout observation and circuit-breaking, shutdown reclamation, runtime registration, period scheduling - MUST NOT be re-implemented at this layer.
SchedulerModel ¶
Bases: ABC
Scheduling model base class.
属性:
| 名称 | 类型 | 描述 |
|---|---|---|
concurrency_primitive |
str
|
one of the concurrency primitive values |
supported_time_semantics |
tuple
|
the time semantics this model can schedule |
backpressure_policy |
str
|
one of the backpressure policy values |
stop_semantics |
str
|
one of the stop semantics values |
supported_worker_kinds |
tuple
|
the supported Worker kinds |
observable_metrics |
tuple
|
the runtime metric names this model can expose |
源代码位于: zoo_framework/core/waiter/scheduler_model.py
describe ¶
The programmatic query entry for the six contract items.
Per instance: items like the backpressure policy may vary with
instance arguments (ThreadPoolModel); a classmethod would read the
class-level empty values and hide the instance's real declaration.
返回:
| 类型 | 描述 |
|---|---|
dict
|
A dict with the six declarations; any empty item means the model |
dict
|
did not declare it correctly |
源代码位于: zoo_framework/core/waiter/scheduler_model.py
start
abstractmethod
¶
Start the model (create the container) and mark it started.
Each model MUST implement this itself: submit requires a started
model, and both models should treat "submit before start" the same way
(refuse, not silently fail).
源代码位于: zoo_framework/core/waiter/scheduler_model.py
submit
abstractmethod
¶
Dispatch the Worker.
Implementations MUST call core.settle on completion so settlement
goes through the single path.
prepare_workers
abstractmethod
¶
Process the Worker list according to the backpressure policy before creating the container.
MUST be called before container creation: expand semantics require
the widened size to be in effect when the pool is built.
返回:
| 类型 | 描述 |
|---|---|
int
|
The capacity this model actually uses (0 when it has no container |
int
|
concept) |
源代码位于: zoo_framework/core/waiter/scheduler_model.py
teardown
abstractmethod
¶
Reclaim the container and mark the model not started. MUST be repeatable.
ThreadPerTaskModel ¶
Bases: SchedulerModel
One thread per task: no backpressure, dispatch never blocks the scheduling round.
Corresponds to the existing worker:mode=thread. Dispatched task threads
are daemon threads; at shutdown in-flight tasks are abandoned rather
than awaited (CPython cannot safely interrupt a running thread).
源代码位于: zoo_framework/core/waiter/scheduler_model.py
start ¶
No thread-pool container to build; mark started so submit's precondition can be checked.
teardown ¶
Dispatched daemon threads are abandoned per the stop semantics; no container to reclaim; mark not started.
prepare_workers ¶
This model starts an independent thread per dispatch with no capacity concept, so no limits apply and 0 is returned.
The backpressure policy is unbounded: never refuses because of the
worker count and never queues.
源代码位于: zoo_framework/core/waiter/scheduler_model.py
ThreadPoolModel ¶
Bases: SchedulerModel
Thread pool: bounded concurrency, handling undersized pools via backpressure_policy.
Corresponds to the existing worker:mode=thread_pool. The three
backpressure policies absorb the only difference among the former
SimpleWaiter / StableWaiter / SafeWaiter: expand / queue /
reject.
Container implementation (change replace-pool-dispatch-queue / #47 P2):
fixed worker threads + a queue.Queue task queue, replacing the old
concurrent.futures.ThreadPoolExecutor - measurements showed Future
bookkeeping dominates the dispatch cost (submit().result() 31.9 us vs
1.86 us via the queue directly, bench/DECISION.md section 4). The six
contract items and the three backpressure semantics are unchanged item by
item: bound = thread count, queue = unbounded FIFO, stop-cancel-queued =
discard not-yet-started tasks.
源代码位于: zoo_framework/core/waiter/scheduler_model.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | |
prepare_workers ¶
Handle "worker count exceeds the pool size" according to the backpressure policy.
Called before the pool is created at startup - expand semantics
require the widened size to be in effect when the pool is built. It is
also the admission entry for runtime registration (BaseWaiter.add_worker,
issue #233): when the pool is already running, the widened size MUST be
applied to the live container as well, or expand would only bump a
number that has no effect (a silent no-op).
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
workers
|
list[BaseWorker | None]
|
the Worker list about to participate in scheduling |
必需 |
返回:
| 类型 | 描述 |
|---|---|
int
|
The pool size this model actually uses |
引发:
| 类型 | 描述 |
|---|---|
ValueError
|
the policy is reject and the worker count exceeds the pool size |
源代码位于: zoo_framework/core/waiter/scheduler_model.py
start ¶
Build the queue and worker threads at the current effective size (sized by prepare_workers before start).
Idempotent: when the container already exists, the thread count is
reconciled up to the effective size (the runtime expand path widens
it via prepare_workers) - threads are never removed here, shrinking
is teardown's job.
源代码位于: zoo_framework/core/waiter/scheduler_model.py
teardown ¶
Shutdown: discard queued not-yet-started tasks (stop_dispatch_cancel_queued), then stop the threads.
Started tasks cannot be interrupted (a CPython limitation, the same as
the old ThreadPoolExecutor implementation); the in-flight table and the
scheduling list are cleared by core.clear() (called from
BaseWaiter.shutdown).
源代码位于: zoo_framework/core/waiter/scheduler_model.py
派发与结算¶
zoo_framework.core.waiter.dispatch_core ¶
Dispatch core: model-agnostic bookkeeping and correctness logic.
Five kinds of logic MUST be owned by this core; new scheduling models MUST NOT re-implement them:
- Single settlement path (
settle) - clears the in-flight record and reports the result on success. All concurrency primitives share this one path, so results are delivered under any of them. - Timeout observation and circuit-breaking (
reap_timeout) - record only, mark unhealthy, stop dispatching. CPython cannot safely interrupt a running thread, so the system MUST NOT claim it terminated one. - Shutdown resource reclamation (the
shutdownpath) - stop dispatching, clear the in-flight table; reclaiming the concurrency container (e.g. a thread pool) is provided by the model viateardown. - Runtime registration (
add_worker) - the scheduling list is owned by this core; being listed in a registry alone is not enough for a Worker to be dispatched. - Period scheduling (
is_due/jitter/skipped_count) - period and phase are per-Worker declarations, independent of the concurrency primitive; if each model implemented its own, the absolute sequence, skip semantics and jitter sampling would be implemented multiple times and inevitably diverge.
Holds a second model-agnostic concurrency contract: the in-flight table and
the broken set are guarded by a single threading.RLock (both are
accessed concurrently by the dispatch thread and completion callbacks), plus
runtime metric counters.
Time base: every interval quantity in this module MUST use time.monotonic()
and MUST NOT mix in wall-clock time.
WorkerDispatchCore ¶
Dispatch core.
属性:
| 名称 | 类型 | 描述 |
|---|---|---|
workers |
list
|
the list of Workers participating in scheduling |
worker_props |
dict
|
the in-flight table, worker name -> |
broken |
set
|
the set of circuit-broken (timed-out) worker names |
stopped |
the shutdown flag |
|
default_run_timeout |
the global default timeout; |
源代码位于: zoo_framework/core/waiter/dispatch_core.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 | |
set_workers ¶
Set the list of Workers participating in scheduling.
add_worker ¶
Admit a Worker newly registered at runtime into scheduling.
The scheduling list is owned by this core; being listed in a registry alone is not enough for the Worker to be dispatched.
This method only appends to the scheduling list and implements no
capacity admission. The backpressure policy MUST be applied by the
scheduler (BaseWaiter.add_worker passes the prospective list through
model.prepare_workers) before this is called, otherwise a
runtime-registered Worker would bypass the policy (issue #233).
源代码位于: zoo_framework/core/waiter/dispatch_core.py
retain_looping ¶
Filter the Workers that stay in the scheduling list after this round.
All three conditions must hold: non-empty, not circuit-broken, and declared looping. Broken Workers MUST be removed from the list, or they would be re-evaluated every round (and "broken means stop dispatching" would lose its meaning). One-shot Workers do not take part in the next round - "exactly once" here is a scheduling-bookkeeping semantic (the same task is never dispatched twice concurrently), not a delivery attempt semantic: delivery is at-least-once and a failed event callback is retried by EventReactor (consumers needing exactly-once bring their own idempotency; the framework does not build in idempotency keys).
源代码位于: zoo_framework/core/waiter/dispatch_core.py
resolve_period ¶
Resolve the Worker's period: self-report -> per-name override -> global default.
The result is cached per worker name (#47 P1) while the three-stage semantics are preserved item by item: falsy self-reported/override values (0 / False / "") still fall through to the next stage per the existing rules, and the cache MUST NOT change that.
返回:
| 类型 | 描述 |
|---|---|
float | None
|
The period in seconds; None when undeclared (callers then treat the |
float | None
|
Worker as event-driven) |
源代码位于: zoo_framework/core/waiter/dispatch_core.py
resolve_phase ¶
Resolve the Worker's phase offset: self-report -> per-name override -> global default.
The result is cached per worker name (#47 P1). Phase is the classic
falsy case: an explicit phase: 0 in config is a valid value, so the
cache check MUST be sentinel comparison rather than truthiness.
返回:
| 类型 | 描述 |
|---|---|
float
|
The phase offset in seconds; 0.0 when undeclared |
源代码位于: zoo_framework/core/waiter/dispatch_core.py
is_due ¶
Whether the Worker is due at this moment.
Periodic scheduling computes trigger times from a monotonic-clock absolute sequence (base + phase + n x period); it MUST NOT schedule as "last execution finish time + period", which drifts cumulatively each round.
When one round of execution spans several theoretical trigger times, the missed rounds are skipped and the next trigger is the next future time on the sequence; catch-up runs MUST NOT happen (catch-up self-amplifies under sustained overload).
The scheduling base is the moment of the Worker's first due check (the framework has no process-level scheduling epoch), so the first trigger lands at "first-check time + phase" and later theoretical times are "base + phase + n x period".
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
worker
|
BaseWorker
|
the target Worker |
必需 |
now
|
float | None
|
the current monotonic time; None takes |
None
|
返回:
| 类型 | 描述 |
|---|---|
bool
|
Whether due; always True for Workers without a declared period |
bool
|
(event-driven semantics) |
源代码位于: zoo_framework/core/waiter/dispatch_core.py
skipped_count ¶
jitter ¶
The Worker's trigger jitter summary.
Workers without a declared period return the explicit "not applicable" marker and MUST NOT return 0.
源代码位于: zoo_framework/core/waiter/dispatch_core.py
begin ¶
Register a Worker that is about to be dispatched.
Registration MUST precede dispatch: if the task were submitted before the registration, an instantly finishing task would deregister itself before the registration lands, leaving an in-flight record that is never cleared, and the Worker would never be dispatched again.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
worker
|
BaseWorker
|
the target Worker |
必需 |
timeout
|
float | None
|
the relative timeout in seconds |
必需 |
deadline
|
float | None
|
an absolute deadline (monotonic-clock base); when given
it takes precedence over |
None
|
返回:
| 类型 | 描述 |
|---|---|
dict | None
|
The registration entry; None if already in flight (the caller MUST |
dict | None
|
NOT dispatch) |
源代码位于: zoo_framework/core/waiter/dispatch_core.py
attach_container ¶
Attach the container (thread or Future) carrying this Worker to its registration.
源代码位于: zoo_framework/core/waiter/dispatch_core.py
abort ¶
Roll back the registration: clear the entry on dispatch failure so the next round can retry.
settle ¶
The single completion settlement: deregister in-flight state and report the result on success.
Deregistration MUST happen regardless of success; an exception raised by the reporting step itself MUST NOT affect deregistration.
The run identity stamped on the result comes from the registration entry (not the current context) - settlement may happen on a worker thread whose context differs from dispatch time; the identity in the registration entry is the source of truth.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
worker
|
BaseWorker
|
the Worker that finished executing |
必需 |
result
|
Any
|
the execution result; None on failure |
None
|
error
|
BaseException | None
|
the exception raised during execution; None on success |
None
|
源代码位于: zoo_framework/core/waiter/dispatch_core.py
run_and_settle ¶
Execute once on a worker thread and settle.
This is the model- and primitive-independent execution unit: the
dispatching side MUST wrap it with carry_context(core.run_and_settle)
before submitting, or the worker thread will not inherit the caller's
context and the run identity will be silently lost at dispatch time.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
worker
|
BaseWorker
|
the Worker to execute |
必需 |
源代码位于: zoo_framework/core/waiter/dispatch_core.py
resolve_run_timeout ¶
Resolve the Worker's run timeout: self-report -> per-name override -> global default.
The result is cached per worker name (#47 P1); the global default comes
from default_run_timeout, which does not change after construction
(changing it would require invalidating the cache in step; there is
currently no such runtime entry point).
返回:
| 类型 | 描述 |
|---|---|
float | None
|
The timeout in seconds; None when undeclared |
源代码位于: zoo_framework/core/waiter/dispatch_core.py
reap_timeout ¶
Timeout evaluation and circuit-breaking.
Observation and circuit-breaking only: record, mark unhealthy, stop dispatching. The system MUST NOT claim it terminated a still-running Worker - CPython cannot safely interrupt a running thread.
One of the two deadline sources applies: the absolute deadline given at registration takes precedence; otherwise the relative timeout is used.
返回:
| 类型 | 描述 |
|---|---|
bool
|
Whether this evaluation found the Worker timed out |
源代码位于: zoo_framework/core/waiter/dispatch_core.py
run_worker
staticmethod
¶
Execute one Worker.
返回:
| 类型 | 描述 |
|---|---|
WorkerResult | None
|
WorkerResult; None when the worker is not a valid BaseWorker |
源代码位于: zoo_framework/core/waiter/dispatch_core.py
mark_stopped ¶
Set the stopped flag.
返回:
| 类型 | 描述 |
|---|---|
bool
|
Whether this call is the first shutdown (repeated calls return |
bool
|
False) |
源代码位于: zoo_framework/core/waiter/dispatch_core.py
clear ¶
Clear the scheduling list, the in-flight table and the period-scheduling state.
Period scheduling is reset as well: after a shutdown a fresh start should establish a new base rather than reuse the old sequence.
源代码位于: zoo_framework/core/waiter/dispatch_core.py
metrics ¶
Runtime metrics: in-flight count, cumulative completions, timeout circuit-breaks.
MUST be queryable at runtime, MUST NOT be available only at shutdown.
Jitter is per-Worker observation, queried via jitter(worker), so
it is not aggregated here.
源代码位于: zoo_framework/core/waiter/dispatch_core.py
常量¶
zoo_framework.constant.worker_constant.WorkerConstant ¶
Worker run mode and run policy constants.
Implemented: RUN_MODE_THREAD and three run policies.
RUN_MODE_PROCESS / RUN_MODE_COROUTINE and their abbreviations
are unimplemented placeholders - process mode requires pickleable
Workers; coroutine mode has no scheduling entry yet.
Unimplemented constants MUST NOT be silently treated as other modes.
源代码位于: zoo_framework/constant/worker_constant.py
zoo_framework.constant.waiter_constant.WaiterConstant ¶
Scheduler constants.
Implemented worker modes: WORKER_MODE_THREAD and
WORKER_MODE_THREAD_POOL.
Unimplemented modes (placeholders): WORKER_MODE_PROCESS and
WORKER_MODE_PROCESS_POOL - process modes require pickleable Workers
and cross-process communication, no implementation provided yet.
A request for an unimplemented mode MUST be rejected explicitly and
MUST NOT silently run as another mode.