Synchronous scheduler for fixed logical partitions, independent of worker identity. @ownership Caller retains shared adapter lease; callbacks are borrowed only until execute returns. @thread Invoked by the Crowd owner; bodies may run concurrently on workers. @reentrancy Bodies must not reenter or mutate Crowd through public APIs. No callbacks under a lock. 更多...
#include <CrowdWorkScheduler.h>
Public 成员函数 | |
| virtual | ~CrowdWorkScheduler ()=default |
| Release the adapter after every synchronous dispatch has joined. | |
| virtual Result< void > | execute (int partitions, const std::function< void(int)> &body)=0 |
| Execute each partition exactly once, joining every dispatched body on success or failure. | |
详细描述
Synchronous scheduler for fixed logical partitions, independent of worker identity. @ownership Caller retains shared adapter lease; callbacks are borrowed only until execute returns. @thread Invoked by the Crowd owner; bodies may run concurrently on workers. @reentrancy Bodies must not reenter or mutate Crowd through public APIs. No callbacks under a lock.
在文件 CrowdWorkScheduler.h 第 13 行定义.
构造及析构函数说明
◆ ~CrowdWorkScheduler()
|
virtualdefault |
Release the adapter after every synchronous dispatch has joined.
成员函数说明
◆ execute()
|
pure virtual |
Execute each partition exactly once, joining every dispatched body on success or failure.
- 参数
-
partitions Nonnegative partition count. body Borrowed native callback; each invocation owns its partition's output slots.
- 返回
- Failure after join; never retry or silently execute serial work. @ownership No callback or data reference survives this call. @thread Owner dispatch, concurrent worker callbacks. @reentrancy No Crowd reentry. @cost Linear scheduling work per partition; amortize with fixed 256-item logical partitions.
该类的文档由以下文件生成:
- src/modules/crowd/CrowdWorkScheduler.h