Asyncore
Static Public Member Functions | List of all members
Asyncore\stdin Class Reference

Static Public Member Functions

static init (?callable $line_function=null, bool $essential=true)
 
static isInitialized ()
 
static getNextLine ()
 

Member Function Documentation

◆ getNextLine()

static Asyncore\stdin::getNextLine ( )
static

Blocks until the user has submitted a line and then returns it.

Returns
string
Exceptions
BadMethodCallExceptionif stdin was not initialized via stdin::init

◆ init()

static Asyncore\stdin::init ( ?callable  $line_function = null,
bool  $essential = true 
)
static

Initializes Asyncore's STDIN handling, if it wasn't already, enabling the "stdin_line" event and the stdin::getNextLine() function. After this, STDIN is in Asyncore's hands, and there's no way out.

Parameters
callable | null$line_functionThe function to be called when the user has submitted a line.
bool$essentialIf false, the STDIN loop will be registered as inessential, so it doesn't prevent Asyncore::loop() from returning.
Returns
void

◆ isInitialized()

static Asyncore\stdin::isInitialized ( )
static

Returns whether Asyncore's STDIN handling was initialized.

Returns
bool
Since
2.1