This is automatic generated document for things in Swow\Selector class

Class Selector

channel selector selects any action done which action can be “pushing/poping T into/from (may be different) channel”

This class is a generic class. Template T

Constants

public EVENT_POP = 1 public EVENT_PUSH = 0

Methods

Method commit

public function commit ( int $timeout ) : \Swow\Channel<T>

do select

any actions in selector will make this return

The first ready action wins. With no ready action the call waits for the timeout.

context switching may happen here

Param int $timeout timeout in milliseconds

Throws SelectorException on timeout or failure

Method fetch

public function fetch ( ) : mixed

Get the value of the last pop event.

Returns mixed the value

Throws \Error when no data is available: a push event, no commit, or a failed commit

Method getLastEvent

public function getLastEvent ( ) : int

Get the event of the last successful commit.

Returns int the event, or EVENT_NONE

Method pop

public function pop ( \Swow\Channel<T> $channel ) : static

add a “popping a T from $channel” action into selector

Method push

public function push ( \Swow\Channel<T> $channel , T $data ) : static

add a “pushing a T into $channel” action into selector


Copyright 2022 the Swow contributors

This site uses Just the Docs, a documentation theme for Jekyll.