OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017, the Dart 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 file. |
| 4 |
| 5 import 'dart:isolate'; |
| 6 |
| 7 import 'package:analyzer_plugin/plugin/plugin.dart'; |
| 8 import 'package:analyzer_plugin/src/channel/isolate_channel.dart'; |
| 9 import 'package:analyzer_plugin/starter.dart'; |
| 10 |
| 11 /** |
| 12 * The [Driver] class represents a single running instance of an analysis |
| 13 * server plugin. It is responsible for handling the communications with the |
| 14 * server and forwarding requests on to the plugin. |
| 15 */ |
| 16 class Driver implements ServerPluginStarter { |
| 17 /** |
| 18 * The plugin that will be started. |
| 19 */ |
| 20 final ServerPlugin plugin; |
| 21 |
| 22 /** |
| 23 * Initialize a newly created driver that can be used to start the given |
| 24 * plugin. |
| 25 */ |
| 26 Driver(this.plugin); |
| 27 |
| 28 @override |
| 29 void start(SendPort sendPort) { |
| 30 IsolateChannel channel = new IsolateChannel(sendPort); |
| 31 plugin.start(channel); |
| 32 } |
| 33 } |
OLD | NEW |