Skip to content

Commit 26f7f9a

Browse files
authored
Update README.md
1 parent 00910be commit 26f7f9a

1 file changed

Lines changed: 18 additions & 14 deletions

File tree

README.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
1-
# "Quantum" Network Channels in Golang
1+
# "Quantum" Network Channels in Go
22

33
[![GoDoc](https://godoc.org/github.com/matveynator/netchan?status.svg)](https://godoc.org/github.com/matveynator/netchan?flush=1)
44

55
## Introduction
66

7-
Go channels are widely recognized for their simplicity and power in handling concurrent tasks. In essence, Go channels can be seen as "quantum" channels where data transmission mimics quantum properties: data disappears from the sender the moment it appears at the receiver. This seamless handoff ensures synchronization and provides the foundation for highly concurrent systems.
7+
Go 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.
88

9-
The `netchan` library aspires to bring these "quantum" capabilities to the network level, enabling Go developers to leverage channel-like abstractions across machines. 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 communication and synchronization will be the key to unlocking its full potential.
9+
The `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.
1010

11-
> **Note:** The project is in active development. Contributions and testing are welcome as we continue to refine and expand its capabilities.
11+
> **Note:** The project is under active development. Contributions and testing are welcome to continue refining and enhancing its capabilities.
1212
1313
## Why "Quantum" Network Channels?
1414

15-
In 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 a challenge due to the lack of an equivalent hypervisor that ensures synchronization without creating intermediate data copies.
15+
In 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.
1616

17-
While `netchan` currently enables data transfer across machines, it doesn’t yet replicate the synchronization behavior found in native Go channels. This limitation presents a unique opportunity for innovation:
17+
While `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:
1818

19-
1. **Designing a Network Hypervisor**: Developing a system that guarantees seamless, synchronized data transfer between sender and receiver.
19+
1. **Developing a Network Hypervisor**: Creating a system that guarantees seamless, synchronized data transfer between sender and receiver.
2020
2. **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.
2121

2222
## Overview
2323

2424
`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.
2525

26+
For more details on implementation, refer to the [Documentation](wiki/README.md).
27+
2628
## netchan Usage Example
2729

2830
This 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`).
@@ -37,7 +39,7 @@ import (
3739
```
3840

3941
### Step 2: Create a Server
40-
Set up a server that listens on a specified IP address and port. Handle any errors that might occur during this process.
42+
Set up a server that listens on a specified IP address and port. Handle any errors that might occur.
4143

4244
```go
4345
send, receive, err := netchan.Listen("127.0.0.1:9876")
@@ -67,20 +69,20 @@ message := <-receive
6769
### Step 5: Sending Messages
6870
To send a message, either from the server to the client or in the opposite direction, use the `send` channel.
6971

70-
> As a Golang developer, be aware that netchan's send operation is non-blocking and sends messages instantly. However, network problems 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. Remember this for reliable network application messaging.
72+
> 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.
7173
7274
```go
7375
send <- message
7476
```
7577

76-
This basic example demonstrates how to set up a 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.
78+
This 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.
7779

7880
## Current Limitations and Future Directions
7981

8082
While `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:
8183

8284
1. **Synchronization Features**:
83-
- Current implementation lacks synchronization at the network level, meaning that it doesn’t yet coordinate process timing or mutual exclusion like native Go channels.
85+
- Current implementation lacks synchronization at the network level, meaning it does not yet coordinate process timing or mutual exclusion like native Go channels.
8486
- Future versions aim to incorporate mechanisms that mimic the "quantum" synchronization properties of Go channels over the network.
8587

8688
2. **Network Hypervisor**:
@@ -90,7 +92,7 @@ While `netchan` excels at enabling cross-machine communication, its synchronizat
9092
3. **Scalability Enhancements**:
9193
- While `netchan` supports basic scalability, advanced use cases like large distributed systems will require further optimization and robust error handling.
9294

93-
## Benchmark
95+
## Benchmarks
9496

9597
```
9698
Benchmark netchan (TLS 1.3 + GOB Encode/Decode) via localhost:9999
@@ -100,7 +102,7 @@ Intel(R) Core(TM) m3-7Y32 CPU @ 1.10GHz 1 core:
100102
Sent: 1092349 (33101 msg/sec) - 3677 msg/sec per client
101103
Received: 1092340 (33100 msg/sec) - 3677 msg/sec per client
102104
Processed: 2184672 (64263 msg/sec)
103-
Not received: 10 msg in 33 seconds
105+
Not received: 10 messages in 33 seconds
104106
Successfully connected 9 clients
105107
106108
... (other benchmarks here)
@@ -110,6 +112,8 @@ Successfully connected 9 clients
110112

111113
Should 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.
112114

115+
For general goals, package structure, and implementation details, visit the [General Documentation](wiki/README.md).
116+
113117
## Similar Projects
114118

115119
Here are some projects related to Go network channels:
@@ -121,4 +125,4 @@ Here are some projects related to Go network channels:
121125

122126
## License
123127

124-
`netchan` is distributed under the BSD-style License. For detailed information, please refer to the [LICENSE](https://github.com/matveynator/netchan/blob/master/LICENSE) file.
128+
`netchan` is distributed under the BSD-style License. For detailed information, please refer to the [LICENSE](https://github.com/matveynator/netchan/blob/master/LICENSE).

0 commit comments

Comments
 (0)