{"id":48566885,"url":"https://github.com/matveynator/netchan","last_synced_at":"2026-04-08T13:03:33.400Z","repository":{"id":342847019,"uuid":"713288689","full_name":"matveynator/netchan","owner":"matveynator","description":"Quantum Network Channels (netchan) for Golang: Secure, cluster-ready, supports nested channels \u0026 any data type. Inspired by Rob Pike.","archived":false,"fork":false,"pushed_at":"2026-03-07T17:19:22.000Z","size":223,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-07T22:34:10.957Z","etag":null,"topics":["bi-directional","channels","cluster","cluster-computing","concurrent-programming","csp","go","golang","network","peer-to-peer"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matveynator.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":"security.go","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":"2023-11-02T08:11:49.000Z","updated_at":"2026-03-07T17:19:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/matveynator/netchan","commit_stats":null,"previous_names":["matveynator/netchan"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/matveynator/netchan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matveynator%2Fnetchan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matveynator%2Fnetchan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matveynator%2Fnetchan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matveynator%2Fnetchan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matveynator","download_url":"https://codeload.github.com/matveynator/netchan/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matveynator%2Fnetchan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31556247,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T10:21:54.569Z","status":"ssl_error","status_checked_at":"2026-04-08T10:21:38.171Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["bi-directional","channels","cluster","cluster-computing","concurrent-programming","csp","go","golang","network","peer-to-peer"],"created_at":"2026-04-08T13:03:33.313Z","updated_at":"2026-04-08T13:03:33.394Z","avatar_url":"https://github.com/matveynator.png","language":"Go","readme":"# \"Quantum\" Network Channels in Go\n\n[![GoDoc](https://godoc.org/github.com/matveynator/netchan?status.svg)](https://godoc.org/github.com/matveynator/netchan?flush=1)\n\n## Introduction\n\nGo channels are widely known for their simplicity and power in managing concurrent tasks. Essentially, Go channels can be seen as \"quantum\" channels where data transmission mimics quantum properties: data disappears from the sender at the exact moment it appears at the receiver. This seamless interaction ensures synchronization and serves as the foundation for highly concurrent systems.\n\nThe `netchan` library aims to bring these \"quantum\" capabilities to the network level, enabling Go developers to use channel-like abstractions for machine-to-machine interaction. However, unlike Go’s native channels, `netchan` in its current implementation primarily focuses on data transmission and does not yet fully replicate the synchronization features of Go channels. Expanding `netchan` to achieve both data transmission and synchronization will be key to its full potential.\n\n\u003e **Note:** The project is under active development. Contributions and testing are welcome to continue refining and enhancing its capabilities.\n\n## Why \"Quantum\" Network Channels?\n\nIn Go, native channels inherently synchronize data and processes. This is achieved through the Go runtime, which acts as a \"hypervisor,\" managing data exchange with precision. Extending this concept to a networked environment is challenging due to the lack of an equivalent hypervisor ensuring synchronization without creating intermediate data copies.\n\nWhile `netchan` currently enables data transfer across machines, it does not yet replicate the synchronization behavior found in native Go channels. This limitation presents a unique opportunity for innovation:\n\n1. **Developing a Network Hypervisor**: Creating a system that guarantees seamless, synchronized data transfer between sender and receiver.\n2. **Achieving True Quantum Behavior**: Mimicking Go’s channel synchronization at a network level, ensuring that data appears and disappears as if governed by a higher-order control mechanism.\n\n## Overview\n\n`netchan` is a robust library for the Go programming language, offering convenient and secure abstractions for network channel interactions. Inspired by [Rob Pike’s initial concept](https://github.com/matveynator/netchan-old), it aims to deliver an interface that resonates with the simplicity and familiarity of Go’s native channels.\n\nFor more details on implementation, refer to the [Documentation](wiki/README.md).\n\n## Installation\n\n```bash\ngo get github.com/matveynator/netchan@latest\n```\n\nThe module path for imports is:\n\n```go\nimport \"github.com/matveynator/netchan\"\n```\n\nFor release/versioning details, see [Go Modules compatibility](docs/go-modules.md).\n\n## netchan Usage Example\n\nThis guide provides a basic example of how to use the `netchan` package for setting up simple server-client communication in Go. Note that `message` can be any type of data, including a Go channel (`chan`).\n\n### Step 1: Import the Package\nFirst, import the `netchan` package into your Go program.\n\n```go\nimport (\n    \"github.com/matveynator/netchan\"\n)\n```\n\n### Step 2: Create a Server\nSet up a server that listens on a specified IP address and port. Handle any errors that might occur.\n\n```go\nsend, receive, err := netchan.Listen(\"127.0.0.1:9876\")\nif err != nil {\n    // handle error\n}\n```\n\n### Step 3: Create a Client\nCreate a client that connects to the server using the same IP address and port.\n\n```go\nsend, receive, err := netchan.Dial(\"127.0.0.1:9876\")\nif err != nil {\n    // handle error\n}\n```\n\n### Step 4: Receiving Messages\nTo receive a message, whether from server to client or vice versa, use the following code. It waits for a message on the `receive` channel.\n\n```go\nmessage := \u003c-receive\n// process message\n```\n\n### Step 5: Sending Messages\nTo send a message, either from the server to the client or in the opposite direction, use the `send` channel.\n\n\u003e Note: `netchan`'s send operation is non-blocking and sends messages instantly. However, network issues may lead to message loss. Each SEND channel in `netchan` has a one-message buffer. Buffer size customization is being tested and might be available later. Keep this in mind for reliable network application messaging.\n\n```go\nsend \u003c- message\n```\n\nThis basic example demonstrates how to set up simple server-client communication using `netchan`. Remember to handle errors appropriately and ensure that your network addresses and ports are configured correctly for your specific use case.\n\n## Current Limitations and Future Directions\n\nWhile `netchan` excels at enabling cross-machine communication, its synchronization capabilities—a hallmark of Go channels—are still in development. Below are the key limitations and the roadmap for addressing them:\n\n1. **Synchronization Features**:\n   - Current implementation lacks synchronization at the network level, meaning it does not yet coordinate process timing or mutual exclusion like native Go channels.\n   - Future versions aim to incorporate mechanisms that mimic the \"quantum\" synchronization properties of Go channels over the network.\n\n2. **Network Hypervisor**:\n   - There is no system in place to ensure that data is transmitted and received without intermediate copies.\n   - Development of a network hypervisor will be critical for achieving true quantum behavior, enabling seamless, lossless data synchronization between sender and receiver.\n\n3. **Scalability Enhancements**:\n   - While `netchan` supports basic scalability, advanced use cases like large distributed systems will require further optimization and robust error handling.\n\n## Benchmarks\n\n```\nBenchmark netchan (TLS 1.3 + GOB Encode/Decode) via localhost:9999\n\nIntel(R) Core(TM) m3-7Y32 CPU @ 1.10GHz 1 core:\n===============================================\nSent:                  1092349 (33101 msg/sec) - 3677 msg/sec per client\nReceived:              1092340 (33100 msg/sec) - 3677 msg/sec per client\nProcessed:             2184672 (64263 msg/sec)\nNot received:          10 messages in 33 seconds\nSuccessfully connected 9 clients\n\n... (other benchmarks here)\n```\n\n## Community and Support\n\nShould you have inquiries or suggestions, feel free to open an [issue](https://github.com/matveynator/netchan/issues) in our GitHub repository. Contributions are always welcome as we aim to build a library that pushes the boundaries of networked communication in Go.\n\nFor general goals, package structure, and implementation details, visit the [General Documentation](wiki/README.md).\n\n## Similar Projects\n\nHere are some projects related to Go network channels:\n\n- [Netchan (old version)](https://github.com/matveynator/netchan-old) - Rob Pike’s initial concept.\n- [Docker Libchan](https://github.com/docker/libchan) - A lightweight, networked, message-passing interface from Docker.\n- [GraftJS/jschan](https://github.com/GraftJS/jschan) - A JavaScript implementation of similar channel-based communication.\n- [Matryer/Vice](https://github.com/matryer/vice) - Go channels at horizontal scale.\n\n## License\n\n`netchan` is distributed under the BSD-style License. For detailed information, please refer to the [LICENSE](https://github.com/matveynator/netchan/blob/master/LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatveynator%2Fnetchan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatveynator%2Fnetchan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatveynator%2Fnetchan/lists"}