Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
f64c6aae
Unverified
Commit
f64c6aae
authored
4 years ago
by
Patrick Cloke
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update manhole documentation for async/await. (#8462)
parent
c5251c6f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/8462.doc
+1
-0
1 addition, 0 deletions
changelog.d/8462.doc
docs/manhole.md
+5
-2
5 additions, 2 deletions
docs/manhole.md
with
6 additions
and
2 deletions
changelog.d/8462.doc
0 → 100644
+
1
−
0
View file @
f64c6aae
Update the directions for using the manhole with coroutines.
This diff is collapsed.
Click to expand it.
docs/manhole.md
+
5
−
2
View file @
f64c6aae
...
@@ -35,9 +35,12 @@ This gives a Python REPL in which `hs` gives access to the
...
@@ -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
`synapse.server.HomeServer`
object - which in turn gives access to many other
parts of the process.
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:
As a simple example, retrieving an event from the database:
```
```
pycon
>>> hs.get_datastore().get_event('$1416420717069yeQaw:matrix.org')
>>> 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=''>>
<Deferred at 0x7ff253fc6998 current result: <FrozenEvent event_id='$1416420717069yeQaw:matrix.org', type='m.room.create', state_key=''>>
```
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment