withApp<T> method

Future<T> withApp<T>(
  1. AppSession target,
  2. Future<T> body()
)

Runs body bound to target through a zone value, so concurrent calls never see each other's app.

Implementation

Future<T> withApp<T>(AppSession target, Future<T> Function() body) =>
    runZoned(body, zoneValues: {_bindingKey: target});