This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
type Pod struct { | |
Name string | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
ch := make(chan int) | |
close(ch) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
func main() { | |
var ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class VM { | |
Host get host => _host; | |
set host(Host h) { | |
_host = h; | |
} | |
Host _host; | |
void initialize(Host h) { | |
assert(_host == null); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class System { | |
System() { | |
initialize(); | |
} | |
void initialize() { | |
print('System boot start...'); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class Shape { | |
Shape() { | |
print('Shape() constructor'); | |
} | |
void transform(); | |
} | |
class Circle extends Shape { | |
@override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
main() { | |
StreamTransformer transformer = StreamTransformer<num, num>.fromHandlers( | |
handleData: (num val, EventSink sink) { | |
sink.add(-val); | |
} | |
); | |
StreamController controller = StreamController<num>.broadcast( | |
onListen: () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
main() { | |
StreamTransformer transformer = StreamTransformer<num, num>.fromHandlers( | |
handleData: (num val, EventSink sink) { | |
sink.add(val + 1); | |
} | |
); | |
StreamController controller = StreamController<num>(); | |
Stream transformed = controller.stream.transform(transformer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
main() { | |
StreamController controller = StreamController(); | |
controller.stream.listen((val) { | |
print('Event received: $val'); | |
}, onDone: () { | |
print('Stream done'); | |
}); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:core'; | |
import 'dart:async'; | |
Future<bool> exception = Future<bool>.delayed(Duration(seconds: 1), () { | |
print('Somehow, a exception happend...'); | |
throw 'Just a Exception, freeze!'; | |
}); | |
Future procedure = Future(() { |