OpenHiva::SpinOnce
Description
Schedules the group specified by groupName. The subscribed topic is scheduled to process messages in the specified group.
Prototype
uint32_t OpenHiva::SpinOnce(const std::string &groupName)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
groupName |
Input |
Name of a thread group. |
Returns
The return value is of the uint32_t type. If the operation is successful, HIVA_SUCCESS (value being 0) is returned. If other values are returned, the operation fails.
Usage
None
Precautions
- The value of groupName must match the value of groupName of a ScheduleGroup member in the schedGroupVec input parameter of OpenHiva::Init. The value of scheduleType corresponding to groupName must be USER_DEFINED. Otherwise, SpinOnce returns a failure message.
- You are advised not to directly invoke this interface in the main thread. If the message size is too large, page faults may be frequently triggered during interface invoking. As a result, the CPU usage increases sharply. You are advised to start threads for cyclic invoking.
Parent topic: Initialization/Exit/Scheduling APIs