Skip to content

Don't use async in server code when it's more trouble than it's worth #3332

Closed
@DartBot

Description

@DartBot

This issue was originally filed by jjinux...@google.com


In one of Seth Ladd's slides, he has this:

main() {
  File script = new File(new Options().script);
  script.directory().then((Directory d) {
    runServer(d.path);
  });
}

This requires an asynchronous callback to get d.path. As far as I know, UNIX doesn't actually have an asynchronous file API, so this must be using a thread under the covers. Using a thread in order to provide an asynchronous API with a callback makes both the implementation and the API a lot more complicated, and I don't think there's much benefit in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.closed-not-plannedClosed as we don't intend to take action on the reported issuelibrary-iotype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions