{"id":17535654,"url":"https://github.com/drafakiller/asyncsignal-dart","last_synced_at":"2025-08-27T09:42:29.094Z","repository":{"id":57680711,"uuid":"494161309","full_name":"DrafaKiller/AsyncSignal-dart","owner":"DrafaKiller","description":"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.","archived":false,"fork":false,"pushed_at":"2022-09-26T00:20:50.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T02:43:50.637Z","etag":null,"topics":["async","dart","package"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DrafaKiller.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-19T17:08:00.000Z","updated_at":"2024-07-05T20:44:47.000Z","dependencies_parsed_at":"2022-09-01T14:51:53.067Z","dependency_job_id":null,"html_url":"https://github.com/DrafaKiller/AsyncSignal-dart","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DrafaKiller/AsyncSignal-dart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrafaKiller%2FAsyncSignal-dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrafaKiller%2FAsyncSignal-dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrafaKiller%2FAsyncSignal-dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrafaKiller%2FAsyncSignal-dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DrafaKiller","download_url":"https://codeload.github.com/DrafaKiller/AsyncSignal-dart/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrafaKiller%2FAsyncSignal-dart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272315616,"owners_count":24912609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-27T02:00:09.397Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","dart","package"],"created_at":"2024-10-20T19:08:09.344Z","updated_at":"2025-08-27T09:42:28.989Z","avatar_url":"https://github.com/DrafaKiller.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Pub.dev package](https://img.shields.io/badge/pub.dev-async__signal-blue)](https://pub.dev/packages/async_signal)\n[![GitHub repository](https://img.shields.io/badge/GitHub-AsyncSignal--dart-blue?logo=github)](https://github.com/DrafaKiller/AsyncSignal-dart)\n\n# Async Signal\n\nControl the flow of asynchronous operations by signaling all the waiting tasks whether they should wait or continue at a specific point.\n\nLock or unlock the flow.\n\n## Features\n\n* Control the flow of asynchronous operations\n* Check the status of the signal\n* Wait for the signal to be unlocked\n\n## Getting started\n\nInstall it using pub:\n```\ndart pub add async_signal\n```\n\nAnd import the package:\n```dart\nimport 'package:async_signal/async_signal.dart';\n```\n\n## Usage\n\n```dart\nfinal signal = AsyncSignal();\n\n// Start with it locked\nfinal signal = AsyncSignal(locked: true);\n```\n\nLock or unlock to let everything waiting go through\n```dart\nsignal.lock();\nsignal.unlock();\n```\n\nWait for the signal to be unlocked, if it's already unlocked you will go right through it\n```dart\nawait signal.wait();\n```\n\nClose the signal when you're done using it\n```dart\nsignal.close();\n```\n\n## Is this what you're looking for?\n\n`async_signal` allows you to control a flow, allowing multiple operations to continue at once only when you want, like opening a gate.\n\nIf what you want is a control flow one by one, like in a queue, then you should check out the [`async_locks`](https://pub.dev/packages/async_locks) package.\n\n## GitHub\n\nThe package code is available on Github: [Dart - AsyncSignal](https://github.com/DrafaKiller/AsyncSignal-dart)\n\n## Example\n\n```dart\nfinal signal = AsyncSignal(locked: true);\n\nvoid getIn() async {\n    await signal.wait();\n    print('Finally, I\\'m in!');\n}\n\ngetIn();\nprint('Wait, I will open the door after 3 seconds.');\n\nawait Future.delayed(const Duration(seconds: 3));\n\nprint('Opening the door...');\nsignal.unlock();\n\n// [Output]\n// Wait, I will open the door after 3 seconds.\n\n// 3 seconds later...\n\n// [Output]\n// Opening the door...\n// Finally, I'm in!\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrafakiller%2Fasyncsignal-dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrafakiller%2Fasyncsignal-dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrafakiller%2Fasyncsignal-dart/lists"}