{"id":15008716,"url":"https://github.com/plugfox/plugfox_transformers","last_synced_at":"2025-10-03T16:31:42.703Z","repository":{"id":56837045,"uuid":"257208261","full_name":"PlugFox/plugfox_transformers","owner":"PlugFox","description":"Сontains a set of useful stream transformers","archived":true,"fork":false,"pushed_at":"2020-04-24T23:19:17.000Z","size":18,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-01T10:03:59.055Z","etag":null,"topics":["dart","dart-library","dart-package","dart-web","dart2","dartlang","package","stream","transformer"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/plugfox_transformers","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/PlugFox.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":"2020-04-20T07:46:07.000Z","updated_at":"2023-01-28T01:21:59.000Z","dependencies_parsed_at":"2022-09-06T19:41:03.015Z","dependency_job_id":null,"html_url":"https://github.com/PlugFox/plugfox_transformers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlugFox%2Fplugfox_transformers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlugFox%2Fplugfox_transformers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlugFox%2Fplugfox_transformers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlugFox%2Fplugfox_transformers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PlugFox","download_url":"https://codeload.github.com/PlugFox/plugfox_transformers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235156013,"owners_count":18944827,"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","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":["dart","dart-library","dart-package","dart-web","dart2","dartlang","package","stream","transformer"],"created_at":"2024-09-24T19:20:15.048Z","updated_at":"2025-10-03T16:31:42.412Z","avatar_url":"https://github.com/PlugFox.png","language":"Dart","readme":"# plugfox_transformers  \n  \n[![chatroom icon](https://patrolavia.github.io/telegram-badge/chat.png)](https://t.me/PlugFox)\n[![Pub](https://img.shields.io/pub/v/plugfox_transformers.svg)](https://pub.dartlang.org/packages/plugfox_transformers)  \n  \n## About  \n  \nСontains a set of useful stream transformers\n+ `Simultaneous` (Serves for simultaneous parallel tasks)\n  \n\n## Simultaneous\n  \nServes for simultaneous parallel tasks\n\nExecutes simultaneously `[maxNumberOfProcesses]` generators `[convert]`\ntransforming each `[Event]` into a Stream of `[State]`.\nThe resulting stream is returned from the `[Stream.transform]` method.\n\nIf `[maxNumberOfProcesses]` is set to 0 or less, then all\nincoming events processed instantly.\n\nIf `[maxNumberOfProcesses]` is set to 1, then the\nbehavior is almost identical .asyncExpand method.\n\nIf `[maxNumberOfProcesses]` is set to 2 or more, then this sets the number\nsimultaneously performed tasks and each subsequent event begins to be processed\nas soon as one of the previous ones is finished.\n \nThe transformer breaks the sequence of events in the stream.\n  \n\n### Example usage:\n\n```dart\nStream\u003cString\u003e myGenerator(int event) async* {\n  String state;\n\n  state = await Future\u003cString\u003e.delayed(\n        const Duration(milliseconds: 250)\n      , () =\u003e '$event + 2 = ${event + 2}');\n  yield state;\n  \n  state = await Future\u003cString\u003e.delayed(\n        const Duration(milliseconds: 500)\n      , () =\u003e '$event * 2 = ${event * 2}');\n  yield state;\n  \n  state = await Future\u003cString\u003e.delayed(\n        const Duration(milliseconds: 750)\n      , () =\u003e '$event ^ 2 = ${event * event}');\n  yield state;\n}\n\nStream\u003cint\u003e.fromIterable(const \u003cint\u003e[1, 2, 3, 4, 5, 6, 7])\n  .transform\u003cString\u003e(Simultaneous\u003cint, String\u003e(myGenerator, maxNumberOfProcesses: 2))\n  .forEach(print);\n```\n\n### Override `bloc` package behavior:  \n  \n```dart\n@override  \nStream\u003cTransition\u003cEvent, State\u003e\u003e transformEvents(\n  Stream\u003cEvent\u003e events,\n  Stream\u003cTransition\u003cEvent, State\u003e\u003e Function(Event) next) =\u003e \n    events.transform\u003cTransition\u003cEvent, State\u003e\u003e(\n      Simultaneous\u003cEvent, Transition\u003cEvent, State\u003e\u003e(next, maxNumberOfProcesses: 0)\n    );\n```\n  \n  \n## Changelog  \n  \nRefer to the [Changelog](https://github.com/plugfox/plugfox_transformers/blob/master/CHANGELOG.md) to get all release notes.  \n  \n  \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplugfox%2Fplugfox_transformers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplugfox%2Fplugfox_transformers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplugfox%2Fplugfox_transformers/lists"}