Skip to content
microhodPublic

About

A simple queue using named pipes

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

microhod/warppipe

Package microhod/warppipe implements a queue to share any go types across processes using named pipes.

NOTE: windows is not currently supported

Usage

Writing

import "github.com/micrhohod/warppipe"

type Foo struct {
    Bar string
}

func main() {
    w, err := warppipe.NewWriter[Foo]("/tmp/foo.queue")
    if err != nil {
        panic(err)
    }
    defer close(w)

    v := Foo{
        Bar: "baz",
    }
    if err := w.Write(v); err != nil {
        panic(err)
    }
}

Reading

import "github.com/micrhohod/warppipe"

type Foo struct {
    Bar string
}

func main() {
    r, err := warppipe.NewReader[Foo]("/tmp/foo.queue")
    if err != nil {
        panic(err)
    }
    defer close(r)

    var v Foo
    if err := r.Read(&v); err != nil {
        panic(err)
    }
    fmt.Println(v)
}

Logo License

The Go gopher was designed by Renee French.
http://reneefrench.blogspot.com/
The design is licensed under the Creative Commons 3.0 Attributions license. CC BY 3.0

About

A simple queue using named pipes

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages