summary refs log tree commit diff
path: root/docs/manhole.md
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-10-13 13:29:50 +0100
committerErik Johnston <erik@matrix.org>2020-10-13 13:29:50 +0100
commit43bcb1e54ecb89806529b8daf8d87369f74e9b5f (patch)
treede76fa57336d6b9bbf45f943a6dac6d8e9424e3c /docs/manhole.md
parentblock membership events from spammy freenode bridge (diff)
parentMove additional tasks to the background worker, part 4 (#8513) (diff)
downloadsynapse-43bcb1e54ecb89806529b8daf8d87369f74e9b5f.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'docs/manhole.md')
-rw-r--r--docs/manhole.md7
1 files changed, 5 insertions, 2 deletions
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=''>> ```