Poll the EventBase for active events, run them, then return. Unlike loopOnce, the expectation is that loopPoll will be called multiple times State is therefore persisted across calls to reflect that there is ongoing polling. Control will be returned to the calling thread between iterations. loopPollSetup and loopPollCleanup manage the maintained state across loopPoll calls.

Synopsis

Declared in <folly/io/async/EventBase.h>

bool
loopPoll(LoopPollOptions options = {});

Description

This is useful for callers that want to run the loop manually but under the context that there is continued polling being done by some thread against the EventBase.

Returns the same result as loop().

Must be called within a corresponding pair of loopPollSetup and loopPollCleanup; may be called many times within the pair.

Return Value

True if the loop completed normally, false on error.

Parameters

Name

Description

options

whether the function can block waiting for active events. nonblock true: return immediately after all active events are processed. nonblock false: block and keep running active events, until waken up by notification.

Created with MrDocs