SetaPDF_Core_Reader_MaxFileHandler Class that handles SetaPDF_Core_Reader_MaxFile instances.

File: /SetaPDF v2/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

protected SetaPDF_Core_Reader_MaxFile[] SetaPDF_Core_Reader_MaxFileHandler::$_instances = array()

The reader instances

$_maxOpenHandles

protected int SetaPDF_Core_Reader_MaxFileHandler::$_maxOpenHandles = 1000

Maximum open handles

$_openHandles

protected int SetaPDF_Core_Reader_MaxFileHandler::$_openHandles = 0

Currently open handles.


Methods

__construct()

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

The constructor.

Parameters
$maxOpenHandles : int
 

createReader()

Helper method to create a reader instance.

Parameters
$filename
 
See

ensureFreeHandle()

Ensures a free handle.

getInstances()

Get all reader instances registered in this handler instance.

getMaxOpenHandles()

Get the maximum open handles.

getOpenHandles()

Get the currently opened handles count.

onHandleClosed()

Shall be triggered if a handle is closed.

onHandleOpened()

Shall be triggered if a handle is opened.

setMaxOpenHandles()

public SetaPDF_Core_Reader_MaxFileHandler::setMaxOpenHandles (
int $maxOpenHandles
): void

Set the maximum open handles.

Parameters
$maxOpenHandles : int