{"id":16944633,"url":"https://github.com/krgn/fsharp-zmq","last_synced_at":"2026-05-21T05:33:34.951Z","repository":{"id":152791462,"uuid":"64338834","full_name":"krgn/fsharp-zmq","owner":"krgn","description":"A pattern for working with ZeroMQ sockets in Async workflows. ","archived":false,"fork":false,"pushed_at":"2016-07-27T21:52:08.000Z","size":3155,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T08:21:23.376Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"F#","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/krgn.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-27T20:15:53.000Z","updated_at":"2016-07-27T20:16:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc660146-46a0-402d-ba26-ea53835996e8","html_url":"https://github.com/krgn/fsharp-zmq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/krgn/fsharp-zmq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krgn%2Ffsharp-zmq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krgn%2Ffsharp-zmq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krgn%2Ffsharp-zmq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krgn%2Ffsharp-zmq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krgn","download_url":"https://codeload.github.com/krgn/fsharp-zmq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krgn%2Ffsharp-zmq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33289867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T02:57:32.698Z","status":"ssl_error","status_checked_at":"2026-05-21T02:57:31.990Z","response_time":62,"last_error":"SSL_read: 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-10-13T21:18:47.623Z","updated_at":"2026-05-21T05:33:34.945Z","avatar_url":"https://github.com/krgn.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ZeroMQ sockets in FSharp\n\nUsing `ZeroMQ` socket in asynchronous computations in `FSharp` can be a daunting task. The reason\nbehind that is that `ZeroMQ` sockets are explicitly _not_ thread-safe. This is apparently about to\nchange:\n\n\u003cblockquote class=\"twitter-tweet\" data-lang=\"en\"\u003e\u003cp lang=\"en\" dir=\"ltr\"\u003e\u003ca href=\"https://twitter.com/krstngbbrt\"\u003e@krstngbbrt\u003c/a\u003e there\u0026#39;s a new generation of socket types (client, server, radio, dish, scatter, gather) that are threadsafe.\u003c/p\u003e\u0026mdash; Pieter Hintjens (@hintjens) \u003ca href=\"https://twitter.com/hintjens/status/757889447996391429\"\u003eJuly 26, 2016\u003c/a\u003e\u003c/blockquote\u003e\n\u003cscript async src=\"//platform.twitter.com/widgets.js\" charset=\"utf-8\"\u003e\u003c/script\u003e\n\nUntil these new, thread-safe socket types land in a proper release and get integrated into the\n`.NET` `ZeroMQ` package I need a solution to allow me to pass around and use sockets on different\nthreads while still guaranteeing that all sockets get closed an disposed of properly.\n\nThe demo I cooked up in this repository makes heavy use of `AutoResetEvent` signaling and a single\nlocking step to synchronize yet another background thread which in turn owns the ZeroMQ socket. \n\nTake a [look at the source to see how its done.](https://github.com/krgn/fsharp-zmq/blob/master/zmq.tests/zmq.tests.fs)\n\n# Usage\n\nBuild the thing using `Fake` like this:\n\n```\n./build.sh # or .\\build.cmd on windows\n```\n\nThen start the program in your console and type-in how many random numbers you want to compute the\nsquare of. Thats it. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrgn%2Ffsharp-zmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrgn%2Ffsharp-zmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrgn%2Ffsharp-zmq/lists"}