{"id":20315260,"url":"https://github.com/sysread/nl-event","last_synced_at":"2026-02-07T18:03:40.009Z","repository":{"id":6160489,"uuid":"7390100","full_name":"sysread/nl-event","owner":"sysread","description":"libevent2 support for newlisp","archived":false,"fork":false,"pushed_at":"2013-01-04T19:55:32.000Z","size":149,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-10-11T07:26:29.100Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Common Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sysread.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-31T18:56:24.000Z","updated_at":"2023-06-23T14:25:28.000Z","dependencies_parsed_at":"2022-08-31T15:50:59.849Z","dependency_job_id":null,"html_url":"https://github.com/sysread/nl-event","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sysread/nl-event","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2Fnl-event","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2Fnl-event/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2Fnl-event/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2Fnl-event/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysread","download_url":"https://codeload.github.com/sysread/nl-event/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2Fnl-event/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29203024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T17:44:10.191Z","status":"ssl_error","status_checked_at":"2026-02-07T17:44:07.936Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-14T18:18:31.996Z","updated_at":"2026-02-07T18:03:39.959Z","avatar_url":"https://github.com/sysread.png","language":"Common Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"nl-event\n================================================================================\n\nThe libevent module provides a wrapper on top of the [libevent2\nlibrary](http://libevent.org/).\n\n\nTodo\n--------------------------------------------------------------------------------\n* Signals\n\n\nTimers\n--------------------------------------------------------------------------------\n    ; --------------------------------------------------------------------------\n    ; Timers\n    ; --------------------------------------------------------------------------\n    (libevent:init)\n\n    (libevent:set-interval 10\n      (fn () (println \"Another 10ms have passed!\")))\n\n    (libevent:run)\n\n\nEvents\n--------------------------------------------------------------------------------\n    (libevent:init)\n    (setf socket (net-connect \"www.google.com\" 80))\n    (setf buffer \"\")\n\n    ; Wait until socket is write-ready\n    (libevent:watch-once socket libevent:WRITE\n      (fn (fd e id)\n        ; send HTTP request\n        (write socket \"GET / HTTP/1.0\\r\\n\\r\\n\")\n\n        ; wait for response\n        (libevent:watch socket libevent:READ\n          (fn (fd e id , buf bytes)\n            ; read to local buffer\n            (setf bytes (read fd buf 4096))\n            (if bytes\n              ; write to global buffer\n              (write buffer buf)\n              ; kill watcher and stop loop\n              (begin\n                (libevent:unwatch id)\n                (libevent:stop)))))))\n\n    (libevent:run)\n    (println buffer)\n\n\nBuffers\n--------------------------------------------------------------------------------\n    (libevent:init)\n    \n    (setf html \"\")\n    \n    (define (on-read data)\n      (write html data))\n    \n    (define (on-event ev data)\n      (cond\n        ((libevent:masks? ev libevent:BUFFER_EOF)\n         (write html data)\n         (println \"Disconnected\")\n         (libevent:stop))\n        ((libevent:masks? ev libevent:BUFFER_ERROR)\n         (println \"An error occurred\")\n         (libevent:stop))\n        ((libevent:masks? ev libevent:BUFFER_TIMEOUT)\n         (println \"Timed out\")\n         (libevent:stop))))\n    \n    (or (setf socket (net-connect \"www.google.com\" 80))\n        (throw-error \"Unable to connect\"))\n    \n    (setf buffer (libevent:make-buffer socket (regex-comp \"[\\r\\n]+\" 4) on-read on-event))\n    (libevent:buffer-send buffer \"GET / HTTP/1.0\\r\\n\\r\\n\")\n    (libevent:run)\n    \n    (println html)\n\n\nLicense\n--------------------------------------------------------------------------------\nCopyright (C) 2012 \"Jeff Ober\"\n\nThis program is free software; you can redistribute it and/or modify it\nunder the terms of either: the GNU General Public License as published\nby the Free Software Foundation; or the Artistic License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysread%2Fnl-event","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysread%2Fnl-event","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysread%2Fnl-event/lists"}