Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Unified Diff: lib/appengine.dart

Issue 775043002: Add withAppEngineService() to package:appengine (Closed) Base URL: git@github.com:dart-lang/appengine.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/src/appengine_internal.dart » ('j') | lib/src/appengine_internal.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/appengine.dart
diff --git a/lib/appengine.dart b/lib/appengine.dart
index 7e77dc908bb7b572798b4656d3878e7b26541989..da74ea8b5d9bad56c3df66f3a0f36b14eb0aacb5 100644
--- a/lib/appengine.dart
+++ b/lib/appengine.dart
@@ -7,13 +7,13 @@ library appengine;
import 'dart:async';
import 'dart:io';
+export 'package:gcloud/http.dart';
import 'package:gcloud/service_scope.dart' as ss;
import 'src/appengine_internal.dart' as appengine_internal;
import 'src/app_engine_request_handler.dart';
import 'src/client_context.dart';
-export 'package:gcloud/http.dart';
export 'api/errors.dart';
export 'api/logging.dart';
export 'api/modules.dart';
@@ -69,6 +69,19 @@ Future runAppEngine(AppEngineRequestHandler handler, {Function onError}) {
}
/**
+ * Runs [callback] inside a new service scope with appengine services added.
+ *
+ * The services available to `callback` are all non-request specific appengine
+ * services e.g. `memcacheService`, `dbService`.
+ *
+ * See `package:gcloud/service_scope.dart` for more information on service
+ * scopes.
Søren Gjesse 2014/12/03 11:17:42 Please add the example from the code-review here.
kustermann 2014/12/03 11:55:29 Done -- added sample code. Actually I think it's
Søren Gjesse 2014/12/03 13:09:01 In principle I am fine with this change to what th
+ */
+Future withAppEngineServices(Future callback()) {
+ return appengine_internal.withAppEngineServices(callback);
+}
+
+/**
* Returns the [ClientContext] of the current request.
*
* This getter can only be called inside a request handler which was passed to
« no previous file with comments | « no previous file | lib/src/appengine_internal.dart » ('j') | lib/src/appengine_internal.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698