Overview

Namespaces

  • bandwidthThrottle
    • tokenBucket
      • storage
        • scope

Classes

  • FileStorage
  • IPCStorage
  • MemcachedStorage
  • MemcacheStorage
  • PDOStorage
  • PHPRedisStorage
  • PredisStorage
  • SessionStorage
  • SingleProcessStorage

Interfaces

  • Storage

Exceptions

  • StorageException
  • Overview
  • Namespace
  • Class

Class IPCStorage

Shared memory based storage which can be shared among processes of a single host.

This storage is in the global scope. However the scope is limited to the shared memory. I.e. the scope is not shared between hosts.

bandwidthThrottle\tokenBucket\storage\IPCStorage implements bandwidthThrottle\tokenBucket\storage\Storage, bandwidthThrottle\tokenBucket\storage\scope\GlobalScope
Final
Namespace: bandwidthThrottle\tokenBucket\storage
License: WTFPL
Author: Markus Malkusch markus@malkusch.de
Link: Donations
Located at storage/IPCStorage.php
Methods summary
public
# __construct( integer $key )

Sets the System V IPC key for the shared memory and its semaphore.

Sets the System V IPC key for the shared memory and its semaphore.

You can create the key with PHP's function ftok().

Parameters

$key
The System V IPC key.

Throws

bandwidthThrottle\tokenBucket\storage\StorageException
Could initialize IPC infrastructure.
public
# setMicrotime( float $microtime )

Parameters

$microtime
The timestamp.

Throws

bandwidthThrottle\tokenBucket\storage\StorageException
Writing to the storage failed.

Suppresswarnings(phpmd)

public float
# getMicrotime( )

Returns

float
The timestamp.

Throws

bandwidthThrottle\tokenBucket\storage\StorageException
Reading from the storage failed.

Suppresswarnings(phpmd)

API documentation generated by ApiGen