Overview

Namespaces

  • Evenement
  • None
  • PHP
  • Psr
    • Http
      • Message
  • Ratchet
    • Http
    • RFC6455
      • Handshake
      • Messaging
    • Server
    • Session
      • Serialize
      • Storage
        • Proxy
    • Wamp
    • WebSocket
  • React
    • EventLoop
      • Tick
      • Timer
    • Socket
    • Stream
  • Symfony
    • Component
      • HttpFoundation
        • Session
          • Attribute
          • Flash
          • Storage
            • Handler
            • Proxy
      • Routing
        • Annotation
        • Exception
        • Generator
          • Dumper
        • Loader
          • DependencyInjection
        • Matcher
          • Dumper
        • Tests
          • Annotation
          • Fixtures
            • AnnotatedClasses
            • OtherAnnotatedClasses
          • Generator
            • Dumper
          • Loader
          • Matcher
            • Dumper

Classes

  • ExtEventLoop
  • Factory
  • LibEventLoop
  • LibEvLoop
  • StreamSelectLoop

Interfaces

  • LoopInterface
  • Overview
  • Namespace
  • Class
  • Tree

Interface LoopInterface

Direct known implementers

React\EventLoop\ExtEventLoop, React\EventLoop\LibEventLoop, React\EventLoop\LibEvLoop, React\EventLoop\StreamSelectLoop
Namespace: React\EventLoop
Located at LoopInterface.php
Methods summary
public
# addReadStream( resource $stream, callable $listener )

Register a listener to be notified when a stream is ready to read.

Register a listener to be notified when a stream is ready to read.

Parameters

$stream
resource
$stream The PHP stream resource to check.
$listener
callable
$listener Invoked when the stream is ready.
public
# addWriteStream( resource $stream, callable $listener )

Register a listener to be notified when a stream is ready to write.

Register a listener to be notified when a stream is ready to write.

Parameters

$stream
resource
$stream The PHP stream resource to check.
$listener
callable
$listener Invoked when the stream is ready.
public
# removeReadStream( resource $stream )

Remove the read event listener for the given stream.

Remove the read event listener for the given stream.

Parameters

$stream
resource
$stream The PHP stream resource.
public
# removeWriteStream( resource $stream )

Remove the write event listener for the given stream.

Remove the write event listener for the given stream.

Parameters

$stream
resource
$stream The PHP stream resource.
public
# removeStream( resource $stream )

Remove all listeners for the given stream.

Remove all listeners for the given stream.

Parameters

$stream
resource
$stream The PHP stream resource.
public React\EventLoop\Timer\TimerInterface
# addTimer( integer|float $interval, callable $callback )

Enqueue a callback to be invoked once after the given interval.

Enqueue a callback to be invoked once after the given interval.

The execution order of timers scheduled to execute at the same time is not guaranteed.

Parameters

$interval
integer|float
$interval The number of seconds to wait before execution.
$callback
callable
$callback The callback to invoke.

Returns

React\EventLoop\Timer\TimerInterface
public React\EventLoop\Timer\TimerInterface
# addPeriodicTimer( integer|float $interval, callable $callback )

Enqueue a callback to be invoked repeatedly after the given interval.

Enqueue a callback to be invoked repeatedly after the given interval.

The execution order of timers scheduled to execute at the same time is not guaranteed.

Parameters

$interval
integer|float
$interval The number of seconds to wait before execution.
$callback
callable
$callback The callback to invoke.

Returns

React\EventLoop\Timer\TimerInterface
public
# cancelTimer( React\EventLoop\Timer\TimerInterface $timer )

Cancel a pending timer.

Cancel a pending timer.

Parameters

$timer
React\EventLoop\Timer\TimerInterface
$timer The timer to cancel.
public boolean
# isTimerActive( React\EventLoop\Timer\TimerInterface $timer )

Check if a given timer is active.

Check if a given timer is active.

Parameters

$timer
React\EventLoop\Timer\TimerInterface
$timer The timer to check.

Returns

boolean
True if the timer is still enqueued for execution.
public
# nextTick( callable $listener )

Schedule a callback to be invoked on the next tick of the event loop.

Schedule a callback to be invoked on the next tick of the event loop.

Callbacks are guaranteed to be executed in the order they are enqueued, before any timer or stream events.

Parameters

$listener
callable
$listener The callback to invoke.
public
# futureTick( callable $listener )

Schedule a callback to be invoked on a future tick of the event loop.

Schedule a callback to be invoked on a future tick of the event loop.

Callbacks are guaranteed to be executed in the order they are enqueued.

Parameters

$listener
callable
$listener The callback to invoke.
public
# tick( )

Perform a single iteration of the event loop.

Perform a single iteration of the event loop.

public
# run( )

Run the event loop until there are no more tasks to perform.

Run the event loop until there are no more tasks to perform.

public
# stop( )

Instruct a running event loop to stop.

Instruct a running event loop to stop.

Ratchet API documentation generated by ApiGen 2.8.0