8000 Make all async functions return a Future · Issue #31 · centrifugal/centrifuge-dart · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Make all async functions return a Future #31
Closed
@synw

Description

@synw

Would it be possible to return a future for all async methods? I have noticed that some async methods return void and not Future<void> which make then non awaitable. Is this on purpose?

Ex: I would like to await connect but can't because it does not return a future:

@override
  void connect() async {
    return _connect();
  }

Here _connect returns a future, and connect would be great this way:

 Future<void> connect() async {
   return await _connect();
 }
// or the short way
 Future<void> connect() async => _connect();

Is it possible or the actual way is by design?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0