{"id":15819737,"url":"https://github.com/huumn/suv","last_synced_at":"2025-08-23T01:35:15.292Z","repository":{"id":144237233,"uuid":"252760111","full_name":"huumn/suv","owner":"huumn","description":"async io (tcp sockets now) for Chez Scheme via libuv","archived":false,"fork":false,"pushed_at":"2020-04-22T02:23:34.000Z","size":30,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-06T06:43:08.289Z","etag":null,"topics":["asyncio","libuv","scheme","socket","tcp"],"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/huumn.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":"2020-04-03T14:44:29.000Z","updated_at":"2024-04-11T23:17:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"86f9ae63-1dd7-4fa9-bbc2-ecb93c03e175","html_url":"https://github.com/huumn/suv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/huumn/suv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huumn%2Fsuv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huumn%2Fsuv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huumn%2Fsuv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huumn%2Fsuv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huumn","download_url":"https://codeload.github.com/huumn/suv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huumn%2Fsuv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271730307,"owners_count":24811080,"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-22T02:00:08.480Z","response_time":65,"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":["asyncio","libuv","scheme","socket","tcp"],"created_at":"2024-10-05T06:42:55.872Z","updated_at":"2025-08-23T01:35:15.258Z","avatar_url":"https://github.com/huumn.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# suv\nasync io (tcp sockets now) for [Chez Scheme](https://scheme.com) via [libuv](https://github.com/libuv/libuv)\n\n## Heads up\nThe api is *guaranteed* to change\n\n## Getting Started\nInstall libuv then ...\n```bash\ngit clone git@github.com:huumn/suv.git \ncd suv\ncc -o3 -fPIC -shared c/suv.c -luv -o libsuv.so\nmkdir lib\nln -s `pwd` lib\nscheme --libdirs .. --script examples/echo.sc\n```\n\n## Examples\n### Echo\n```Scheme\n(import (suv suv))\n\n(suv-listen \"127.0.0.1\"\n\t    8000\n\t    (lambda (client)\n\t      (suv-accept client)\n\t      (suv-read-start client\n\t\t\t      (lambda (req)\n\t\t\t\t(suv-write client\n\t\t\t\t\t   req)))\n\t      (suv-write client\n\t\t\t (format \"Welcome to Echo server, ~a!\\r\\n\"\n\t\t\t\t (suv-getpeername client)))))\n\n(suv-run)\n```\n\n### State via closure\n```Scheme\n(import (suv suv))\n\n(suv-listen \"127.0.0.1\"\n\t    8000\n\t    (lambda (client)\n\t      (suv-accept client)\n\t      (suv-read-start client\n\t\t\t      (let ([acc '()])\n\t\t\t\t(lambda (req)\n\t\t\t\t  (set! acc (append acc (list req)))\n\t\t\t\t  (if (\u003e (length acc) 1)\n\t\t\t\t      (begin\n\t\t\t\t\t(suv-write client\n\t\t\t\t\t\t   (apply string-append\n\t\t\t\t\t\t\t  acc))\n\t\t\t\t\t(set! acc '()))))))\n\t      (suv-write client\n\t\t\t \"Welcome, I echo after 2 requests!\\r\\n\")))\n\n(suv-run)\n```\n\n### Client\n```Scheme\n(import (suv suv))\n\n(suv-connect \"127.0.0.1\"\n\t     8000\n\t     (lambda (server)\n\t       (suv-read-start server\n\t\t\t       (lambda (req)\n\t\t\t\t (display req)\n\t\t\t\t (flush-output-port)))\n\t       (suv-write server\n\t\t\t  \"Howdy, echo server!\\r\\n\")))\n\n(suv-run)\n```\n\n## Note\n* Again, the API *will* change\n* The library only supports operations on TCP sockets currently\n* Performance is not really considered (and likely won't be for some time). That said, making it higher performing is straightfoward\n  - Use a mempool\n  - Don't copy memory on the request/response path (e.g. when calling in and out of Chez)\n  - Provide an async api for other blocking operations that might be performed\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuumn%2Fsuv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuumn%2Fsuv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuumn%2Fsuv/lists"}