Google\Cloud\Datastore\DatastoreSessionHandler::__construct PHP Method

__construct() public method

Create a custom session handler backed by Cloud Datastore.
public __construct ( DatastoreClient $datastore, integer $gcLimit = self::DEFAULT_GC_LIMIT )
$datastore DatastoreClient Datastore client.
$gcLimit integer [optional] A number of entities to delete in the garbage collection. Defaults to 0 which means it does nothing. The value larger than 1000 will be cut down to 1000.
    public function __construct(DatastoreClient $datastore, $gcLimit = self::DEFAULT_GC_LIMIT)
    {
        $this->datastore = $datastore;
        // Cut down to 1000
        $this->gcLimit = min($gcLimit, 1000);
    }