https://github.com/ozgio/iopipe
Provides the function Parallel to create a synchronous in memory pipe and lets you write to and read from the pipe parallelly.
https://github.com/ozgio/iopipe
Last synced: 2 months ago
JSON representation
Provides the function Parallel to create a synchronous in memory pipe and lets you write to and read from the pipe parallelly.
- Host: GitHub
- URL: https://github.com/ozgio/iopipe
- Owner: ozgio
- License: mit
- Created: 2022-01-25T16:01:30.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-25T16:04:07.000Z (over 4 years ago)
- Last Synced: 2024-06-19T20:53:52.707Z (about 2 years ago)
- Language: Go
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Parallel IO Pipe
iopipe provides the function Parallel to create a synchronous in memory pipe and lets you write to
and read from the pipe parallely.
## Usage
```go
// Writes `Hello world` to standard output
err := iopipe.Parallel(context.Background(), func(ctx context.Context, w io.Writer) error {
_, err := fmt.Fprint(w, "Hello World")
return err
}, func(ctx context.Context, r io.Reader) error {
_, err := io.Copy(os.Stdout, pr)
return err
})
```