WriteHistory
in package
A limited history of recent socket write length/success.
Facilitates retrying zero-length writes a limited number of times, avoiding infinite loops.
Based on a patch from https://github.com/leprechaun https://github.com/pda/pheanstalk/pull/24
A bitfield could be used instead of an array for efficiency.
Tags
Table of Contents
- $_data : mixed
- $_limit : mixed
- __construct() : mixed
- hasWrites() : mixed
- isFull() : mixed
- Whether the history has reached its limit of entries.
- isFullWithNoWrites() : mixed
- log() : mixed
- Logs the return value from a write call.
Properties
$_data
private
mixed
$_data
= array()
$_limit
private
mixed
$_limit
Methods
__construct()
public
__construct(int $limit) : mixed
Parameters
- $limit : int
Return values
mixed —hasWrites()
public
hasWrites() : mixed
Return values
mixed —isFull()
Whether the history has reached its limit of entries.
public
isFull() : mixed
Return values
mixed —isFullWithNoWrites()
public
isFullWithNoWrites() : mixed
Return values
mixed —log()
Logs the return value from a write call.
public
log(mixed $write) : mixed
Returns the input value.
Parameters
- $write : mixed