runZoned<R> method

R runZoned <R>(R body(), { HttpClient createHttpClient(SecurityContext), String findProxyFromEnvironment(Uri uri, Map<String, String> environment), ZoneSpecification zoneSpecification, Function onError })

Runs body in a fresh Zone using the provided overrides.

Implementation

static R runZoned<R>(R body(),
    {HttpClient Function(SecurityContext) createHttpClient,
    String Function(Uri uri, Map<String, String> environment)
        findProxyFromEnvironment,
    ZoneSpecification zoneSpecification,
    Function onError}) {
  HttpOverrides overrides =
      new _HttpOverridesScope(createHttpClient, findProxyFromEnvironment);
  return _asyncRunZoned<R>(body,
      zoneValues: {_httpOverridesToken: overrides},
      zoneSpecification: zoneSpecification,
      onError: onError);
}