Files
pyGoEdge-UserPanel/.venv/Lib/site-packages/asgiref/__pycache__/local.cpython-312.pyc

44 lines
5.8 KiB
Plaintext
Raw Normal View History

2025-11-18 03:36:49 +08:00
<EFBFBD>
g<> i0<00><00>`<00>ddlZddlZddlZddlZddlmZmZmZGd<03>d<04>ZGd<05>d<06>Z y)<07>N)<03>Any<6E>Dict<63>Unionc<00>N<00><00>eZdZdZd
d<04>Zd<05>Zdededdf<06>fd<08> Zdeddfd <09>Z <09>xZ
S) <0B>_CVarzStorage utility for Local.<2E>returnNc<00>8<00>tjd<01>|_y)Nz asgiref.local)<03> contextvars<72>
ContextVar<EFBFBD>_data)<01>selfs <20><E:\Project\pygoedge\.venv\Lib\site-packages\asgiref/local.py<70>__init__z_CVar.__init__ s<00><00>?J<>?U<>?U<> <1B>@
<EFBFBD><04>
<EFBFBD>c<00>~<00>|jji<00>} ||S#t$rt|<00>d|<01><02><03><00>wxYw<01>Nz object has no attribute )r <00>get<65>KeyError<6F>AttributeError<6F>r <00>key<65>storage_objects r<00> __getattr__z_CVar.__getattr__sM<00><00><1D><1A><1A><1E><1E><02>+<2B><0E> N<01>!<21>#<23>&<26> &<26><><17> N<01> <20>D<EFBFBD>8<EFBFBD>+D<>S<EFBFBD>G<EFBFBD>!L<>M<> M<> N<01>s<00>"<00><r<00>valuec<00><><00><01>|dk(rt<00>|<00>||<02>S|jji<00>j <00>}|||<|jj |<03>y)Nr )<06>super<65> __setattr__r r<00>copy<70>set)r rrr<00> __class__s <20>rrz_CVar.__setattr__sQ<00><><00> <0E>'<27>><3E><18>7<EFBFBD>&<26>s<EFBFBD>E<EFBFBD>2<> 2<><1D><1A><1A><1E><1E><02>+<2B>0<>0<>2<><0E>#<23><0E>s<EFBFBD><1B> <0C>
<EFBFBD>
<EFBFBD><0E><0E>~<7E>&rc<00><><00>|jji<00>j<00>}||vr||=|jj|<02>yt |<00>d|<01><02><03><00>r)r rrrrrs r<00> __delattr__z_CVar.__delattr__sT<00><00><1D><1A><1A><1E><1E><02>+<2B>0<>0<>2<><0E> <0E>.<2E> <20><1E>s<EFBFBD>#<23> <10>J<EFBFBD>J<EFBFBD>N<EFBFBD>N<EFBFBD>><3E> *<2A> <20>D<EFBFBD>8<EFBFBD>+D<>S<EFBFBD>G<EFBFBD>!L<>M<> Mr)rN) <0B>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rr<00>strrrr"<00> __classcell__<5F>r s@rrrsA<00><><00>$<24>
<EFBFBD>
N<01>'<27>s<EFBFBD>'<27>3<EFBFBD>'<27>4<EFBFBD>'<27>N<01>s<EFBFBD>N<01>t<EFBFBD>Nrrc<00>d<00><00>eZdZdZd
deddfd<05>Zejd<06><00>Zd<07>Z <09>fd<08>Z
d <09>Z <0B>xZ S) <0B>LocalaLocal storage for async tasks.
This is a namespace object (similar to `threading.local`) where data is
also local to the current async task (if there is one).
In async threads, local means in the same sense as the `contextvars`
module - i.e. a value set in an async frame will be visible:
- to other async code `await`-ed from this frame.
- to tasks spawned using `asyncio` utilities (`create_task`, `wait_for`,
`gather` and probably others).
- to code scheduled in a sync thread using `sync_to_async`
In "sync" threads (a thread with no async event loop running), the
data is thread-local, but additionally shared with async code executed
via the `async_to_sync` utility, which schedules async code in a new thread
and copies context across to that thread.
If `thread_critical` is True, then the local will only be visible per-thread,
behaving exactly like `threading.local` if the thread is sync, and as
`contextvars` if the thread is async. This allows genuinely thread-sensitive
code (such as DB handles) to be kept stricly to their initial thread and
disable the sharing across `sync_to_async` and `async_to_sync` wrapped calls.
Unlike plain `contextvars` objects, this utility is threadsafe.
<20>thread_criticalrNc<00><><00>||_tj<00>|_||rtj<00>|_yt <00>|_y<00>N)<07>_thread_critical<61> threading<6E>RLock<63> _thread_lock<63>local<61>_storager)r r,s rrzLocal.__init__Ds8<00><00> /<2F><04><1D>%<25>O<EFBFBD>O<EFBFBD>-<2D><04><19> <0C> <1A>%<25>O<EFBFBD>O<EFBFBD>-<2D>D<EFBFBD>M<EFBFBD>"<22>G<EFBFBD>D<EFBFBD>Mrc#<00><>K<00>|jrpd} tj<00>|s|j<00><01>yt |jd<03>st <00>|j_|jj<00><01>y|j5|j<00><02>ddd<00>y#t$rd}Y<00><>wxYw#1swYyxYw<01>w)NTF<54>cvar) r/<00>asyncio<69>get_running_loop<6F> RuntimeErrorr4<00>hasattrrr6r2)r <00>is_asyncs r<00> _lock_storagezLocal._lock_storageQs<><00><00><><00> <10> <20> <20><1B>H<EFBFBD> !<21><18>(<28>(<28>*<2A><1C>
<1B>m<EFBFBD>m<EFBFBD>#<23><1F>t<EFBFBD>}<7D>}<7D>f<EFBFBD>5<>).<2E><17>D<EFBFBD>M<EFBFBD>M<EFBFBD>&<26>
<1B>m<EFBFBD>m<EFBFBD>(<28>(<28>(<28><16>"<22>"<22><1A>m<EFBFBD>m<EFBFBD>#<23>#<23>"<22><>3 <20> !<21> <20><08> !<21><>2#<23>"<22>s@<00>C<01>B#<00>A%C<01> B4<03> C<01># B1<03>.C<01>0B1<03>1C<01>4B=<07>9Cc<00>f<00>|j<00>5}t||<01>cddd<00>S#1swYyxYwr.)r<<00>getattr<74>r r<00>storages rrzLocal.__getattr__ws&<00><00> <11> <1F> <1F> !<21>W<EFBFBD><1A>7<EFBFBD>C<EFBFBD>(<28>"<22> !<21> !<21>s<00> '<03>0c<00><><00><01>|dvrt<00>|<00>||<02>S|j<00>5}t|||<02>ddd<00>y#1swYyxYw)N)<04>_localr4r/r2)rrr<<00>setattr)r rrr@r s <20>rrzLocal.__setattr__{sD<00><><00> <0E>L<> L<><18>7<EFBFBD>&<26>s<EFBFBD>E<EFBFBD>2<> 2<> <11> <1F> <1F> !<21>W<EFBFBD> <13>G<EFBFBD>S<EFBFBD>%<25> (<28>"<22> !<21> !<21>s <00>=<03>Ac<00>f<00>|j<00>5}t||<01>ddd<00>y#1swYyxYwr.)r<<00>delattrr?s rr"zLocal.__delattr__<5F>s&<00><00> <11> <1F> <1F> !<21>W<EFBFBD> <13>G<EFBFBD>S<EFBFBD> !<21>"<22> !<21> !<21>s<00> '<03>0)F) r#r$r%r&<00>boolr<00>
contextlib<EFBFBD>contextmanagerr<rrr"r(r)s@rr+r+(sE<00><><00><08>6 $<24><04> $<24><14> $<24><10><1E><1E>#$<24><1F>#$<24>J)<29>)<29> "rr+)
r7rGr
r0<00>typingrrrrr+<00>rr<00><module>rKs0<00><01><0E><11><12><10>#<23>#<23>N<01>N<01>@["<22>["r