OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 /// Support for instantiating an object is a separate process and run | 5 /// Support for instantiating an object is a separate process and run |
6 /// funtions in that process opeating on that object. | 6 /// funtions in that process opeating on that object. |
7 library process_object; | 7 library process_object; |
8 | 8 |
9 import 'dart:fletch'; | 9 import 'dart:dartino'; |
10 | 10 |
11 /// Instantiate an object in a process. | 11 /// Instantiate an object in a process. |
12 /// | 12 /// |
13 /// ``` | 13 /// ``` |
14 /// class Adder { | 14 /// class Adder { |
15 /// add(a, b) => return a + b; | 15 /// add(a, b) => return a + b; |
16 /// } | 16 /// } |
17 /// | 17 /// |
18 /// main() { | 18 /// main() { |
19 /// // Create a ProcessObject with an instance of Adder. | 19 /// // Create a ProcessObject with an instance of Adder. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 } | 97 } |
98 | 98 |
99 // Invoke the received closures. | 99 // Invoke the received closures. |
100 while (true) { | 100 while (true) { |
101 // No need for try/catch here. All closures received here are from | 101 // No need for try/catch here. All closures received here are from |
102 // calls to `run`, which will catch all exceptions. | 102 // calls to `run`, which will catch all exceptions. |
103 var fn = channel.receive(); | 103 var fn = channel.receive(); |
104 fn(object); | 104 fn(object); |
105 } | 105 } |
106 } | 106 } |
OLD | NEW |