DescriptionAdd withAppEngineService() to package:appengine
This will allow users to run background tasks which can use API services.
An example usage could look like:
import 'dart:async';
import 'dart:io';
import 'package:appengine/appengine.dart';
Future backgroundWork() {
return dbService.query(Person).run().toList().then((List<Person> persons) {
// Do something with `persons`.
});
}
void mainHandler(HttpRequest request) {
request.response..write('hello world')..close();
}
main() {
withAppEngineServices(() {
return Future.wait([
runAppEngine(mainHandler),
backgroundWork(),
]);
});
}
R=sgjesse@google.com, wibling@google.com
Committed: https://github.com/dart-lang/appengine/commit/1dd6742902a043fccbfe3a2cb62e9d6b38072cec
Patch Set 1 #Patch Set 2 : #
Total comments: 5
Patch Set 3 : Addressed comments #Patch Set 4 : Release v0.2.4 #Patch Set 5 : #Patch Set 6 : Rebased on HEAD #
Messages
Total messages: 17 (5 generated)
|