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

Side by Side Diff: pkg/fletchc/lib/src/verbs/x_end_verb.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 10 months 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE.md file.
4
5 library fletchc.verbs.end_verb;
6
7 import 'infrastructure.dart';
8
9 import '../hub/session_manager.dart' show
10 endSession;
11
12 import 'documentation.dart' show
13 endDocumentation;
14
15 const Action endAction =
16 const Action(end, endDocumentation, requiresTargetSession: true);
17
18 Future<int> end(AnalyzedSentence sentence, VerbContext context) {
19 String name = sentence.targetName;
20 UserSession session = endSession(name);
21 context = context.copyWithSession(session);
22 return session.worker.performTask(
23 new EndSessionTask(name), context.clientConnection, endSession: true);
24 }
25
26 class EndSessionTask extends SharedTask {
27 // Keep this class simple, see note in superclass.
28
29 final String name;
30
31 const EndSessionTask(this.name);
32
33 Future<int> call(
34 CommandSender commandSender,
35 StreamIterator<ClientCommand> commandIterator) {
36 return endSessionTask(name);
37 }
38 }
39
40 Future<int> endSessionTask(String name) {
41 assert(SessionState.internalCurrent.name == name);
42 SessionState.internalCurrent = null;
43 print("Ended session '$name'.");
44 return new Future<int>.value(0);
45 }
OLDNEW
« no previous file with comments | « pkg/fletchc/lib/src/verbs/x_download_tools_verb.dart ('k') | pkg/fletchc/lib/src/verbs/x_servicec_verb.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698