aiopyramid¶
Module contents¶
Run pyramid app using asyncio
Submodules¶
aiopyramid.config module¶
This module provides view mappers for running views in asyncio.
-
class
aiopyramid.config.
AsyncioMapperBase
(**kw)[source]¶ Bases:
pyramid.config.views.DefaultViewMapper
Base class for asyncio view mappers.
aiopyramid.exceptions module¶
aiopyramid.helpers module¶
-
aiopyramid.helpers.
is_generator
(func)[source]¶ Tests whether func is capable of becoming an asyncio.coroutine.
-
aiopyramid.helpers.
run_in_greenlet
(back, future, func, *args, **kwargs)[source]¶ Wait for coroutine func and switch back to the request greenlet setting any result in the future or an Exception where approrpiate.
func is often a view callable
-
aiopyramid.helpers.
spawn_greenlet
(func, *args, **kwargs)[source]¶ Spawns a new greenlet and waits on any asyncio.Future objects returned.
This is used by the Gunicorn worker to proxy a greenlet within an asyncio event loop.
-
aiopyramid.helpers.
spawn_greenlet_on_scope_error
(func)[source]¶ Wraps a callable handling any
ScopeErrors
that may occur because the callable is called from inside of a coroutine.If no
ScopeError
occurs, the callable is executed normally and return arguments are passed through, otherwise, when aScopeError
does occur, a coroutine to retrieve the result of the callable is returned instead.
aiopyramid.traversal module¶
The aiopyramid.traversal module is deprecated, use aiopyramid.helpers.synchronize instead. See http://aiopyramid.readthedocs.io/features.html#traversal.
aiopyramid.tweens module¶
The aiopyramid.tweens module is deprecated. See example in the docs: http://aiopyramid.readthedocs.io/features.html#tweens.