This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# re: nameko entrypoints | |
def wrapt_entrypoint(entrypoint_fn=None, provider=None): | |
""" Transform a callable into a decorator that can be used to declare | |
entrypoints. | |
The callable should indicate a EntrypointProvider class. Usages of the | |
callable will have their kwargs combined with the provider to produce a | |
DependencyFactory for the given wrapped service function. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rpc_factory is what used to be rpc | |
@entrypoint | |
def rpc_factory(expected_exceptions=None): | |
return DependencyFactory(NovaRpcProvider, expected_exceptions) | |
def rpc(service_fn=None, expected_exceptions=None): | |
if service_fn is None: | |
return partial(rpc, expected_exceptions=expected_exceptions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@asyncio.coroutine | |
def slow_method(): | |
yield from perform_a_blocking_call() | |
return 'Done' | |
loop = asyncio.get_event_loop() | |
loop.run_until_complete(slow_method()) | |
loop.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Implicit | |
result = self.make_rpc_call() # implicit switch here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Explicit | |
result = yield from self.make_rpc_call() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Implicit | |
query = self.session.query(Book) | |
book = query.get(1) # implicit switch here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Explicit | |
query = self.session.query(Book) | |
book = yield from query.get(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chapters = book.chapters | |
do_something(chapters) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yield from fill_lazy_attribute(book.chapters) | |
chapters = book.chapters | |
do_something(chapters) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## schema file for OpenLDAP 2.x | |
## Schema for storing Samba user accounts and group maps in LDAP | |
## OIDs are owned by the Samba Team | |
## | |
## Prerequisite schemas - uid (cosine.schema) | |
## - displayName (inetorgperson.schema) | |
## - gidNumber (nis.schema) | |
## | |
## 1.3.6.1.4.1.7165.2.1.x - attributetypes |
OlderNewer