SetaPDF_Core_Reader_MaxFileHandler Class that handles SetaPDF_Core_Reader_MaxFile instances.

File: /SetaPDF/Core/Reader/MaxFileHandler.php

It is responsible for observing the open file handles and ensures that a specific limit is not reached by setting other instances into sleep-mode.

Class hierarchy

Summary

Properties

$_instances

$_maxOpenHandles

Maximum open handles

$_openHandles

Currently open handles.


Methods

__construct()

public SetaPDF_Core_Reader_MaxFileHandler::__construct ( [ int $maxOpenHandles = 1000 ] )

The constructor.

Parameters
$maxOpenHandles : int
 

createReader()

public SetaPDF_Core_Reader_MaxFile SetaPDF_Core_Reader_MaxFileHandler::createReader ( $filename $filename )

Helper method to create a reader instance.

Parameters
$filename : $filename
 
See

ensureFreeHandle()

public void SetaPDF_Core_Reader_MaxFileHandler::ensureFreeHandle ( void )

Ensures a free handle.

getInstances()

public SetaPDF_Core_Reader_MaxFile[] SetaPDF_Core_Reader_MaxFileHandler::getInstances ( void )

Get all reader instances registered in this handler instance.

getMaxOpenHandles()

public int SetaPDF_Core_Reader_MaxFileHandler::getMaxOpenHandles ( void )

Get the maximum open handles.

getOpenHandles()

public int SetaPDF_Core_Reader_MaxFileHandler::getOpenHandles ( void )

Get the currently opened handles count.

onHandleClosed()

public void SetaPDF_Core_Reader_MaxFileHandler::onHandleClosed ( void )

Shall be triggered if a handle is closed.

onHandleOpened()

public void SetaPDF_Core_Reader_MaxFileHandler::onHandleOpened ( void )

Shall be triggered if a handle is opened.

setMaxOpenHandles()

public void SetaPDF_Core_Reader_MaxFileHandler::setMaxOpenHandles ( int $maxOpenHandles )

Set the maximum open handles.

Parameters
$maxOpenHandles : int