{"id":23408847,"url":"https://github.com/integrativesoft/asyncevents","last_synced_at":"2025-04-11T23:52:53.957Z","repository":{"id":240726385,"uuid":"227955708","full_name":"integrativesoft/AsyncEvents","owner":"integrativesoft","description":"Async Events for C#","archived":false,"fork":false,"pushed_at":"2020-08-29T01:31:05.000Z","size":13,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T23:52:49.481Z","etag":null,"topics":["async","async-events","async-programming","asynctask","csharp","events","net-standard"],"latest_commit_sha":null,"homepage":null,"language":"C#","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/integrativesoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-14T02:39:25.000Z","updated_at":"2023-12-26T17:42:08.000Z","dependencies_parsed_at":"2024-05-20T18:28:55.804Z","dependency_job_id":null,"html_url":"https://github.com/integrativesoft/AsyncEvents","commit_stats":null,"previous_names":["integrativesoft/asyncevents"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/integrativesoft%2FAsyncEvents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/integrativesoft%2FAsyncEvents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/integrativesoft%2FAsyncEvents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/integrativesoft%2FAsyncEvents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/integrativesoft","download_url":"https://codeload.github.com/integrativesoft/AsyncEvents/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248497851,"owners_count":21113984,"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":["async","async-events","async-programming","asynctask","csharp","events","net-standard"],"created_at":"2024-12-22T15:17:44.146Z","updated_at":"2025-04-11T23:52:53.934Z","avatar_url":"https://github.com/integrativesoft.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AsyncEvents for C#\n\nThis library adds support for asynchronous events in C#\n\n```csharp\n// BEFORE: Declaration for a regular synchronous event:\npublic event MyEvent OnChange;\n\n// AFTER: Declaration for an asynchronous event:\npublic AsyncEvent OnChangeAsync { get; } = new AsyncEvent();\n```\n\n# Sample application\n\n```csharp\nusing Integrative.Async;\nusing System;\nusing System.Threading.Tasks;\n\nnamespace AsyncEventsSample\n{\n    class Program\n    {\n        // instance that raises async events\n        readonly static MyEventSource source = new MyEventSource();\n\n        // program's Main\n        static async Task Main()\n        {\n            Console.WriteLine(\"Hello World!\");\n            source.OnChangeAsync.Subscribe(ShowCounterAsync);\n            await source.IncreaseAsync();\n            Console.WriteLine(\"Done!\");\n        }\n\n        // handler for events\n        static Task ShowCounterAsync(object sender, CounterChangedEventArgs args)\n        {\n            Console.WriteLine($\"Counter value: {args.Counter}\");\n            return Task.CompletedTask;\n        }\n    }\n\n    // class for async event parameters\n    class CounterChangedEventArgs : EventArgs\n    {\n        public int Counter { get; set; }\n    }\n\n    // class that raises events\n    class MyEventSource\n    {\n        int counter;\n\n        // async event declaration\n        public AsyncEvent\u003cCounterChangedEventArgs\u003e OnChangeAsync { get; }\n            = new AsyncEvent\u003cCounterChangedEventArgs\u003e();\n\n        // method that triggers events\n        public async Task IncreaseAsync()\n        {\n            counter++;\n            await OnChangeAsync.InvokeAsync(this, new CounterChangedEventArgs\n            {\n                Counter = counter\n            });\n        }\n    }\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintegrativesoft%2Fasyncevents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintegrativesoft%2Fasyncevents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintegrativesoft%2Fasyncevents/lists"}