Context for currently running tasks and transactions.
Bases: google.cloud.ndb.context._Context
User management of cache and other policy.
Create new instance of _ContextTuple(id, client, namespace, eventloop, batches, commit_batches, transaction, cache, global_cache, on_commit_callbacks, transaction_complete_callbacks, legacy_data)
Call a callback upon successful commit of a transaction.
If not in a transaction, the callback is called immediately.
In a transaction, multiple callbacks may be registered and will be called once the transaction commits, in the order in which they were registered. If the transaction fails, the callbacks will not be called.
If the callback raises an exception, it bubbles up normally. This means: If the callback is called immediately, any exception it raises will bubble up immediately. If the call is postponed until commit, remaining callbacks will be skipped and the exception will bubble up through the transaction() call. (However, the transaction is already committed at that point.)
callback (Callable) – The callback function.
Call a callback upon completion of a transaction.
If not in a transaction, the callback is called immediately.
In a transaction, multiple callbacks may be registered and will be called once the transaction completes, in the order in which they were registered. Callbacks are called regardless of whether transaction is committed or rolled back.
If the callback raises an exception, it bubbles up normally. This means: If the callback is called immediately, any exception it raises will bubble up immediately. If the call is postponed until commit, remaining callbacks will be skipped and the exception will bubble up through the transaction() call. (However, the transaction is already committed or rolled back at that point.)
callback (Callable) – The callback function.
Clears the in-memory cache.
This does not affect global cache.
Force any pending batch operations to go ahead and run.
Return the current context cache policy function.
Return the current context datastore policy function.
Return the current global cache policy function.
Return the current policy function global cache timeout (expiration).
Return the current global cache policy function.
Return the current policy function global cache timeout (expiration).
Return the current context namespace.
If namespace isn’t set on the context, the client’s namespace will be returned.
The namespace, or None.
Get whether we are already in a retry block.
Get whether a transaction is currently active.
Direct pass-through to memcache client. No longer implemented.
Direct pass-through to memcache client. No longer implemented.
Direct pass-through to memcache client. No longer implemented.
Direct pass-through to memcache client. No longer implemented.
Direct pass-through to memcache client. No longer implemented.
Direct pass-through to memcache client. No longer implemented.
Direct pass-through to memcache client. No longer implemented.
Direct pass-through to memcache client. No longer implemented.
Direct pass-through to memcache client. No longer implemented.
Set the context cache policy function.
Set the context datastore policy function.
Set the global cache policy function.
Set the policy function for global cache timeout (expiration).
Set the global cache policy function.
Set the policy function for global cache timeout (expiration).
Fetch a resource using HTTP. No longer implemented.
Get the current context.
This function should be called within a context established by google.cloud.ndb.client.Client.context()
.
raise_context_error (bool) – If set to True
, will raise an exception if called outside of a context. Set this to False
in order to have it just return None
if called outside of a context. Default: True
The current context.
exceptions.ContextError – If called outside of a context established by google.cloud.ndb.client.Client.context()
and raise_context_error
is True
.
Get the current top level context.
This function should be called within a context established by google.cloud.ndb.client.Client.context()
.
The toplevel context is the context created by the call to google.cloud.ndb.client.Client.context()
. At times, this context will be superseded by subcontexts, which are used, for example, during transactions. This function will always return the top level context regardless of whether one of these subcontexts is the current one.
raise_context_error (bool) – If set to True
, will raise an exception if called outside of a context. Set this to False
in order to have it just return None
if called outside of a context. Default: True
The current context.
exceptions.ContextError – If called outside of a context established by google.cloud.ndb.client.Client.context()
and raise_context_error
is True
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4