Skip to content

Instantly share code, notes, and snippets.

@rrousselGit
Created April 22, 2022 16:27
Show Gist options
  • Save rrousselGit/6c8d2ec110896d5218f5c9ee222875a5 to your computer and use it in GitHub Desktop.
Save rrousselGit/6c8d2ec110896d5218f5c9ee222875a5 to your computer and use it in GitHub Desktop.
void main() async {
final stream = fn();
print('here');
print(await stream.first);
print('done');
}
Stream<int> fn() async* {
print('try');
try {
while (true) {
print('send message');
yield 1;
await Future.delayed(Duration(seconds: 1));
}
} finally {
print('end');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment