{"id":13812996,"url":"https://github.com/eerimoq/async","last_synced_at":"2025-04-15T08:30:53.726Z","repository":{"id":44573858,"uuid":"222630941","full_name":"eerimoq/async","owner":"eerimoq","description":"🔀 Asynchronous framework in C.","archived":false,"fork":false,"pushed_at":"2022-11-07T07:03:37.000Z","size":1343,"stargazers_count":33,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T18:50:41.204Z","etag":null,"topics":["bare-metal","c","embedded","linux","rtos"],"latest_commit_sha":null,"homepage":"","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/eerimoq.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2019-11-19T07:05:38.000Z","updated_at":"2025-01-22T06:10:16.000Z","dependencies_parsed_at":"2022-09-03T09:24:13.469Z","dependency_job_id":null,"html_url":"https://github.com/eerimoq/async","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eerimoq%2Fasync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eerimoq%2Fasync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eerimoq%2Fasync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eerimoq%2Fasync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eerimoq","download_url":"https://codeload.github.com/eerimoq/async/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249035299,"owners_count":21202053,"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":["bare-metal","c","embedded","linux","rtos"],"created_at":"2024-08-04T04:00:59.466Z","updated_at":"2025-04-15T08:30:52.815Z","avatar_url":"https://github.com/eerimoq.png","language":"C","funding_links":[],"categories":["OS","programming framework"],"sub_categories":["Event based scheduler","event"],"readme":"|buildstatus|_\n|codecov|_\n|nala|_\n\n🔀 Async\n=======\n\nAsynchronous framework in C for systems where low memory usage is\nimportant.\n\nFeatures\n========\n\n- Delayed (asynchronous) function calls.\n\n- Timers.\n\n- An MQTT client (only QoS 0 is supported).\n\n- A simple shell.\n\n- TCP client and server.\n\n- Secure communication with SSL/TLS.\n\nProject homepage: https://github.com/eerimoq/async\n\nReleases: https://github.com/eerimoq/async/releases\n\nExamples\n========\n\nThe hello world example, printing 'Hello world!' periodically.\n\n.. code-block:: c\n\n   #include \u003cstdio.h\u003e\n   #include \"async.h\"\n\n   static void on_timeout()\n   {\n       printf(\"Hello world!\\n\");\n   }\n\n   int main()\n   {\n       struct async_t async;\n       struct async_timer_t timer;\n\n       async_init(\u0026async);\n       async_set_runtime(\u0026async, async_runtime_create());\n       async_timer_init(\u0026timer, on_timeout, NULL, 0, 1000, \u0026async);\n       async_timer_start(\u0026timer);\n       async_run_forever(\u0026async);\n\n       return (0);\n   }\n\nThere are more examples in the `examples folder`_.\n\nRuntimes\n========\n\nA runtime implements zero or more of the following features:\n\n- Timer handling.\n\n- Networking (TCP).\n\n- Call functions in the worker pool.\n\n- Call functions from any thread.\n\nDefault\n-------\n\nThe default runtime does not implement any runtime features. It's\ndesigned for minimal dependencies and easy integration in any\napplication.\n\nTypical usage:\n\n.. code-block:: c\n\n   async_init(\u0026async);\n   ...\n   while (true) {\n       epoll_wait(...);\n       ...\n       if (timeout) {\n           async_tick(\u0026async);\n       }\n       async_process(\u0026async);\n   }\n\nNative\n------\n\nThe native runtime implements all runtime features.\n\nTypical usage:\n\n.. code-block:: c\n\n   async_init(\u0026async);\n   async_set_runtime(\u0026async, async_runtime_create());\n   ...\n   async_run_forever(\u0026async);\n\nDesign\n======\n\nInput\n-----\n\nFirst ``*_input(self_p)`` is called to signal that data is\navailable. Then read data with ``*_read(self_p, buf_p, size)``.\n\nOutput\n------\n\nWrite data with ``*_write(self_p, buf_p, size)``.\n\nUnit testing\n============\n\nSource the development environment setup script.\n\n.. code-block:: shell\n\n   $ source setup.sh\n\nExecute all unit tests.\n\n.. code-block:: shell\n\n   $ make -s -j4 test\n   ...\n\nExecute tests matching given pattern.\n\n.. code-block:: shell\n\n   $ make -s -j4 ARGS=core_timer test\n   ...\n\n.. |buildstatus| image:: https://travis-ci.org/eerimoq/async.svg?branch=master\n.. _buildstatus: https://travis-ci.org/eerimoq/async\n\n.. |codecov| image:: https://codecov.io/gh/eerimoq/async/branch/master/graph/badge.svg\n.. _codecov: https://codecov.io/gh/eerimoq/async\n\n.. |nala| image:: https://img.shields.io/badge/nala-test-blue.svg\n.. _nala: https://github.com/eerimoq/nala\n\n.. _examples folder: https://github.com/eerimoq/async/tree/master/examples\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feerimoq%2Fasync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feerimoq%2Fasync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feerimoq%2Fasync/lists"}