Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
ó
ëEYc@s`ddlZddlZejeƒZdefd„ƒYZeƒZdefd„ƒYZ	dS(iÿÿÿÿNtNeedRegenerationExceptioncBseZdZRS(sAn exception that when raised in the 'with' block,
    forces the 'has_value' flag to False and incurs a
    regeneration of the value.

    (t__name__t
__module__t__doc__(((sA/home/tvault/.virtenv/lib/python2.7/site-packages/dogpile/lock.pyRstLockcBsPeZdZdd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
RS(	séDogpile lock class.

    Provides an interface around an arbitrary mutex
    that allows one thread/process to be elected as
    the creator of a new value, while other threads/processes
    continue to return the previous version
    of that value.

    :param mutex: A mutex object that provides ``acquire()``
     and ``release()`` methods.
    :param creator: Callable which returns a tuple of the form
     (new_value, creation_time).  "new_value" should be a newly
     generated value representing completed state.  "creation_time"
     should be a floating point time value which is relative
     to Python's ``time.time()`` call, representing the time
     at which the value was created.  This time value should
     be associated with the created value.
    :param value_and_created_fn: Callable which returns
     a tuple of the form (existing_value, creation_time).  This
     basically should return what the last local call to the ``creator()``
     callable has returned, i.e. the value and the creation time,
     which would be assumed here to be from a cache.  If the
     value is not available, the :class:`.NeedRegenerationException`
     exception should be thrown.
    :param expiretime: Expiration time in seconds.  Set to
     ``None`` for never expires.  This timestamp is compared
     to the creation_time result and ``time.time()`` to determine if
     the value returned by value_and_created_fn is "expired".
    :param async_creator: A callable.  If specified, this callable will be
     passed the mutex as an argument and is responsible for releasing the mutex
     after it finishes some asynchronous value creation.  The intent is for
     this to be used to defer invocation of the creator callable until some
     later time.

    cCs1||_||_||_||_||_dS(N(tmutextcreatortvalue_and_created_fnt
expiretimet
async_creator(tselfRRRRR	((sA/home/tvault/.virtenv/lib/python2.7/site-packages/dogpile/lock.pyt__init__6s
				cCs6|j|ƒp5|jdk	o5tjƒ||jkS(sPReturn true if the expiration time is reached, or no
        value is available.N(t
_has_valueRtNonettime(R
tcreatedtime((sA/home/tvault/.virtenv/lib/python2.7/site-packages/dogpile/lock.pyt_is_expiredDscCs
|dkS(sIReturn true if the creation function has proceeded
        at least once.i((R
R((sA/home/tvault/.virtenv/lib/python2.7/site-packages/dogpile/lock.pyRNscCsÈ|j}y|ƒ}|\}}Wn*tk
rNtjdƒt}d}nX|j|ƒ}|tk	rz|\}}|S|tkrÀy|ƒ\}}|SWqÄtk
r¼tdƒ‚qÄXn|SdS(NRiÿÿÿÿsHGeneration function should have just been called by a concurrent thread.(RRtlogtdebugtNOT_REGENERATEDt
_enter_createt	Exception(R
tvalue_fntvalueRt	generated((sA/home/tvault/.virtenv/lib/python2.7/site-packages/dogpile/lock.pyt_enterSs&		



cCsN|j|ƒstSt}|j|ƒrN|jjtƒshtjdƒtSntjdƒ|jjƒz»tjd|jƒy|jƒ\}}Wnt	k
r¨n]X|j|ƒsÏtjdƒ||fS|j
rtjdƒ|j
|jƒt}||fStjdƒ|jƒ}|SWd|sI|jj
ƒtjdƒnXdS(Ns2creation function in progress elsewhere, returnings!no value, waiting for create locksvalue creation lock %r acquiredsvalue already presents%Passing creation lock to async runnersCalling creation functionsReleased creation lock(RRtFalseRRtacquireRRRRR	tTrueRtrelease(R
RtasyncRtcreated((sA/home/tvault/.virtenv/lib/python2.7/site-packages/dogpile/lock.pyRns:





	



cCs
|jƒS(N(R(R
((sA/home/tvault/.virtenv/lib/python2.7/site-packages/dogpile/lock.pyt	__enter__™scCsdS(N((R
ttypeRt	traceback((sA/home/tvault/.virtenv/lib/python2.7/site-packages/dogpile/lock.pyt__exit__œsN(RRRR
RRRRRR R#(((sA/home/tvault/.virtenv/lib/python2.7/site-packages/dogpile/lock.pyRs#	
			+	(
Rtloggingt	getLoggerRRRRtobjectRR(((sA/home/tvault/.virtenv/lib/python2.7/site-packages/dogpile/lock.pyt<module>s