Move from deferred to async ModuleApi methods
See original GitHub issueDescription:
Currently some methods of the ModuleApi
are still defer coroutines instead of async defs, such as e.g. check_user_exists
and register_user
, even tho they really are just wrappers with no additional logic. Since the ModuleApi
is slowly moving to mostly async, it’d be great to have those methods be async as well, so modules no longer need a deferred wrapper.
Issue Analytics
- State:
- Created a year ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Efficiently load JavaScript with defer and async - Flavio Copes
async blocks the parsing of the page while defer does not. Blocking rendering. Neither async nor defer guarantee anything on blocking rendering. This...
Read more >Scripts: async, defer - The Modern JavaScript Tutorial
In practice, defer is used for scripts that need the whole DOM and/or their relative execution order is important. And async is used...
Read more >javascript - Script Tag - async & defer - Stack Overflow
Async scripts are executed as soon as the script is loaded, so it doesn't guarantee the order of execution (a script you included...
Read more >goog.async.Deferred - Google
A Deferred represents the result of an asynchronous operation. A Deferred instance has no result when it is created, and is "fired" (given...
Read more >deferred.promise() | jQuery API Documentation
The deferred.promise() method allows an asynchronous function to prevent other code from interfering with the progress or status of its internal request.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You are right. I tested by modifying just that call and it works. Not sure what went wrong in https://github.com/matrix-org/synapse/issues/13948#issuecomment-1263649890, probably something else I changed while refactoring the calls.
Thanks for your patience & help.
Oooh, turns out you’re right. It works by just
await
ing the methods. In this case the issue could also be closed since that allows me to just use the publicModuleApi
methods. Sorry for the noise.