{"id":28215185,"url":"https://github.com/r-lib/nanonext","last_synced_at":"2026-04-04T14:02:39.765Z","repository":{"id":37422778,"uuid":"451104675","full_name":"r-lib/nanonext","owner":"r-lib","description":"R binding for NNG (Nanomsg Next Gen)","archived":false,"fork":false,"pushed_at":"2026-03-29T02:04:43.000Z","size":54304,"stargazers_count":80,"open_issues_count":4,"forks_count":11,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-03-29T04:08:56.945Z","etag":null,"topics":["concurrency","https","ipc-message","messaging-library","nng","r","rpc","socket-communication","synchronization-primitives","tcp-protocol","websocket"],"latest_commit_sha":null,"homepage":"https://nanonext.r-lib.org/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-lib.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-01-23T12:59:16.000Z","updated_at":"2026-03-29T02:01:03.000Z","dependencies_parsed_at":"2024-04-02T13:30:17.826Z","dependency_job_id":"31c26b7b-8cc7-4b8c-84b9-495d494f16a5","html_url":"https://github.com/r-lib/nanonext","commit_stats":{"total_commits":834,"total_committers":1,"mean_commits":834.0,"dds":0.0,"last_synced_commit":"b387153ca79272f8d6dc7298bae9fd2d800b524c"},"previous_names":["r-lib/nanonext","shikokuchuo/nanonext"],"tags_count":54,"template":false,"template_full_name":null,"purl":"pkg:github/r-lib/nanonext","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fnanonext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fnanonext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fnanonext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fnanonext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-lib","download_url":"https://codeload.github.com/r-lib/nanonext/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fnanonext/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31402277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"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":["concurrency","https","ipc-message","messaging-library","nng","r","rpc","socket-communication","synchronization-primitives","tcp-protocol","websocket"],"created_at":"2025-05-17T22:05:43.957Z","updated_at":"2026-04-04T14:02:39.714Z","avatar_url":"https://github.com/r-lib.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r}\n#| include: false\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# nanonext \u003ca href=\"https://nanonext.r-lib.org/\" alt=\"nanonext\"\u003e\u003cimg src=\"man/figures/logo.png\" alt=\"nanonext logo\" align=\"right\" width=\"120\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/nanonext)](https://CRAN.R-project.org/package=nanonext)\n[![R-universe status](https://r-lib.r-universe.dev/badges/nanonext?color=3f72af)](https://r-lib.r-universe.dev/nanonext)\n[![R-CMD-check](https://github.com/r-lib/nanonext/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/nanonext/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/r-lib/nanonext/graph/badge.svg)](https://app.codecov.io/gh/r-lib/nanonext)\n\u003c!-- badges: end --\u003e\n\nFast, lightweight toolkit for messaging, concurrency, and the web in R. Built on [NNG (Nanomsg Next Gen)](https://nng.nanomsg.org/) and implemented almost entirely in C.\n\n- **Scalability protocols** - pub/sub, req/rep, push/pull, surveyor/respondent, bus, pair\n- **Multiple transports** - TCP, IPC, WebSocket, TLS, in-process\n- **Async I/O** - non-blocking operations with auto-resolving 'aio' objects\n- **Cross-language** - exchange data with Python, C++, Go, Rust\n- **Web toolkit** - unified HTTP, WebSocket, and streaming (SSE, NDJSON) on a single port\n\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/r-lib/nanonext)\n\n### Quick Start\n\n```{r}\n#| label: quickstart\nlibrary(nanonext)\n\n# Open sockets\ns1 \u003c- socket(\"req\", listen = \"ipc:///tmp/nanonext\")\ns2 \u003c- socket(\"rep\", dial = \"ipc:///tmp/nanonext\")\n\n# Send\ns1 |\u003e send(\"hello world\")\n\n# Receive on the other\ns2 |\u003e recv()\n\nclose(s1)\nclose(s2)\n```\n\n### Async I/O\n\nNon-blocking operations that resolve automatically:\n\n```{r}\n#| label: async\ns1 \u003c- socket(\"rep\", listen = \"tcp://127.0.0.1:5556\")\ns2 \u003c- socket(\"req\", dial = \"tcp://127.0.0.1:5556\")\n\n# Sender\ns2 |\u003e send(\"async request\")\n\n# Async operations return immediately\naio \u003c- recv_aio(s1)\naio\n\n# Retrieve result when ready\naio$data\n\nclose(s1)\nclose(s2)\n```\n\n### Web Toolkit\n\nOne server, one port -- HTTP endpoints, WebSocket connections, and streaming all coexist. Mbed TLS built in for HTTPS/WSS.\n\n```{r}\n#| label: web\n# Generate self-signed certificates\ncert \u003c- write_cert(cn = \"127.0.0.1\")\n\n# HTTPS server (port 0 = auto-assign a free port)\nserver \u003c- http_server(\n  url = \"https://127.0.0.1:0\",\n  handlers = list(\n    handler(\"/\", \\(req) list(status = 200L, body = '{\"status\":\"ok\"}'))\n  ),\n  tls = tls_config(server = cert$server)\n)\nserver$start()\n\n# Async HTTPS client\naio \u003c- ncurl_aio(server$url, tls = tls_config(client = cert$client))\nwhile (unresolved(aio)) later::run_now(1)\naio$data\n\nserver$close()\n```\n\n### Documentation\n\n| Guide | Topics |\n|:------|:-------|\n| [Quick Reference](https://nanonext.r-lib.org/articles/nanonext.html) | At-a-glance API overview |\n| [Messaging](https://nanonext.r-lib.org/articles/v01-messaging.html) | Cross-language, async, synchronisation |\n| [Protocols](https://nanonext.r-lib.org/articles/v02-protocols.html) | req/rep, pub/sub, surveyor/respondent |\n| [Configuration](https://nanonext.r-lib.org/articles/v03-configuration.html) | TLS, options, serialization |\n| [Web Toolkit](https://nanonext.r-lib.org/articles/v04-web.html) | HTTP client/server, WebSocket, streaming |\n\n### Installation\n\n```{r}\n#| label: cran\n#| eval: false\n# CRAN\ninstall.packages(\"nanonext\")\n\n# Development version\ninstall.packages(\"nanonext\", repos = \"https://r-lib.r-universe.dev\")\n```\n\n\n### Building from Source\n\n#### Linux / Mac / Solaris\n\nRequires 'libnng' \u003e= v1.9.0 and 'libmbedtls' \u003e= 2.5.0, or 'cmake' to compile bundled libraries (libnng v1.11.0, libmbedtls v3.6.5).\n\nRecommended: Let the package compile bundled libraries for optimal performance:\n\n```r\nSys.setenv(NANONEXT_LIBS = 1)\ninstall.packages(\"nanonext\")\n```\n\nSystem packages: libnng-dev / nng-devel, libmbedtls-dev / libmbedtls-devel. Set `INCLUDE_DIR` and `LIB_DIR` for custom locations.\n\n#### Windows\n\nRequires Rtools. For R \u003e= 4.2, cmake is included. Earlier versions need cmake installed separately and added to PATH.\n\n### Links\n\n[Documentation](https://nanonext.r-lib.org/) |\n[NNG](https://nng.nanomsg.org/) |\n[Mbed TLS](https://www.trustedfirmware.org/projects/mbed-tls/) |\n[CRAN HPC Task View](https://cran.r-project.org/view=HighPerformanceComputing) |\n[CRAN Web Technologies](https://cran.r-project.org/view=WebTechnologies)\n\n### Acknowledgements\n\n- [Garrett D'Amore](https://github.com/gdamore) (NNG author) for advice and implementing features for nanonext\n- [R Consortium](https://r-consortium.org/) for funding TLS development, with support from [Henrik Bengtsson](https://github.com/HenrikBengtsson) and [Will Landau](https://github.com/wlandau/)\n- [Joe Cheng](https://github.com/jcheng5/) for prototyping event-driven promises integration\n- [Luke Tierney](https://github.com/ltierney/) and [Mike Cheng](https://github.com/coolbutuseless) for R serialization documentation\n- [Travers Ching](https://github.com/traversc) for novel ideas on custom serialization\n- [Jeroen Ooms](https://github.com/jeroen) for the Anticonf configure script\n\n--\n\nPlease note that this project is released with a [Contributor Code of Conduct](https://nanonext.r-lib.org/CODE_OF_CONDUCT.html). By participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Fnanonext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-lib%2Fnanonext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Fnanonext/lists"}