summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-10-05 09:40:19 -0400
committerGitHub <noreply@github.com>2020-10-05 09:40:19 -0400
commitf64c6aae68932df95a98a75fb707450260b614df (patch)
tree0199505199faca30915fe15bcb7d4bb5ab22958c
parentDo not assume that account data is of the correct form. (#8454) (diff)
downloadsynapse-f64c6aae68932df95a98a75fb707450260b614df.tar.xz
Update manhole documentation for async/await. (#8462)
-rw-r--r--changelog.d/8462.doc1
-rw-r--r--docs/manhole.md7
2 files changed, 6 insertions, 2 deletions
diff --git a/changelog.d/8462.doc b/changelog.d/8462.doc
new file mode 100644

index 0000000000..cf84db6db7 --- /dev/null +++ b/changelog.d/8462.doc
@@ -0,0 +1 @@ +Update the directions for using the manhole with coroutines. diff --git a/docs/manhole.md b/docs/manhole.md
index 7375f5ad46..75b6ae40e0 100644 --- a/docs/manhole.md +++ b/docs/manhole.md
@@ -35,9 +35,12 @@ This gives a Python REPL in which `hs` gives access to the `synapse.server.HomeServer` object - which in turn gives access to many other parts of the process. +Note that any call which returns a coroutine will need to be wrapped in `ensureDeferred`. + As a simple example, retrieving an event from the database: -``` ->>> hs.get_datastore().get_event('$1416420717069yeQaw:matrix.org') +```pycon +>>> from twisted.internet import defer +>>> defer.ensureDeferred(hs.get_datastore().get_event('$1416420717069yeQaw:matrix.org')) <Deferred at 0x7ff253fc6998 current result: <FrozenEvent event_id='$1416420717069yeQaw:matrix.org', type='m.room.create', state_key=''>> ```