|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /opt/alt/python37/lib/python3.7/site-packages/beaker/__pycache__/ |
Upload File : |
B
��[^ � @ s� d Z ddlZddlmZmZmZmZmZ ddlm Z ddl
Z
ddlZddlZddl
mZmZ ddlmZmZmZmZmZ ddd d
ddd
dddddgZe
�d�Ze�e
j�r�ejZndd� ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�Z G dd
� d
e �Z!G dd� de�Z"G dd� de�Z#i Z$e%Z&G dd� de'�Z(ee(�G d d� de��Z)G d!d� de)�Z*G d"d
� d
e)�Z+G d#d� de)�Z,e,Z-dS )$zContainer and Namespace classes� N� )�pickle�anydbm�
add_metaclass�PYVER�unicode_text)�CreationAbortedError�MissingCacheParameter)�
_threading�file_synchronizer�mutex_synchronizer�NameLock�null_synchronizer�Value� Container�ContainerContext�MemoryContainer�DBMContainer�NamespaceManager�MemoryNamespaceManager�DBMNamespaceManager�
FileContainer�OpenResourceNamespaceManager�FileNamespaceManagerr zbeaker.containerc G s d S )N� )�message�argsr r �A/opt/alt/python37/lib/python3.7/site-packages/beaker/container.py�debug s r c @ s� e Zd ZdZedd� �Zdd� Zdd� Zdd � Zd
d� Z dd
� Z
d%dd�Zdd� Zdd� Z
dd� Zdd� Zd&dd�Zdd� Zdd � Zd!d"� Zd#d$� ZdS )'r aH Handles dictionary operations and locking for a namespace of
values.
:class:`.NamespaceManager` provides a dictionary-like interface,
implementing ``__getitem__()``, ``__setitem__()``, and
``__contains__()``, as well as functions related to lock
acquisition.
The implementation for setting and retrieving the namespace data is
handled by subclasses.
NamespaceManager may be used alone, or may be accessed by
one or more :class:`.Value` objects. :class:`.Value` objects provide per-key
services like expiration times and automatic recreation of values.
Multiple NamespaceManagers created with a particular name will all
share access to the same underlying datasource and will attempt to
synchronize against a common mutex object. The scope of this
sharing may be within a single process or across multiple
processes, depending on the type of NamespaceManager used.
The NamespaceManager itself is generally threadsafe, except in the
case of the DBMNamespaceManager in conjunction with the gdbm dbm
implementation.
c C s dS )z`Initialize module-level dependent libraries required
by this :class:`.NamespaceManager`.Nr )�clsr r r �_init_dependencies: s z#NamespaceManager._init_dependenciesc C s | � � || _d S )N)r � namespace)�selfr! r r r �__init__? s zNamespaceManager.__init__c C s
t � �dS )a+ Return a locking object that is used to synchronize
multiple threads or processes which wish to generate a new
cache value.
This function is typically an instance of
:class:`.FileSynchronizer`, :class:`.ConditionSynchronizer`,
or :class:`.null_synchronizer`.
The creation lock is only used when a requested value
does not exist, or has been expired, and is only used
by the :class:`.Value` key-management object in conjunction
with a "createfunc" value-creation function.
N)�NotImplementedError)r"