async_signal 0.0.1 copy "async_signal: ^0.0.1" to clipboard
async_signal: ^0.0.1 copied to clipboard

outdated

Control the flow of asynchronous operations by signaling all the waiting tasks whether they should wait or continue at a specific point. Lock and unlock the flow.

example/lib/main.dart

import 'package:async_signal/async_signal.dart';

void main() async {
  final signal = AsyncSignal(locked: true);

  void getIn() async {
    await signal.wait();
    print('Finally, I\'m in!');
  }

  getIn();
  print('Wait, I will open the door after 3 seconds.');

  await Future.delayed(const Duration(seconds: 3));

  print('Opening the door...');
  signal.unlock();
}

// [Output]
// Wait, I will open the door after 3 seconds.

// 3 seconds later...

// [Output]
// Opening the door...
// Finally, I'm in!
2
likes
0
pub points
67%
popularity

Publisher

verified publisherdrafakiller.com

Control the flow of asynchronous operations by signaling all the waiting tasks whether they should wait or continue at a specific point. Lock and unlock the flow.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on async_signal