fifo

package
v0.10.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2020 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package fifo implements functions to create and open a fifo for inter-process communication in an OS agnostic way. A few assumptions should be made when using this package. First, New() must always be called before Open(). Second Open() returns an io.ReadWriteCloser that is only connected with the io.ReadWriteCloser returned from New().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndRead

func CreateAndRead(path string) (func() (io.ReadCloser, error), error)

CreateAndRead creates a fifo at the given path, and returns an open function for reading. For compatibility with windows, the fifo must not exist already.

It returns a reader open function that may block until a writer opens so it's advised to run it in a goroutine different from reader goroutine

func IsClosedErr

func IsClosedErr(err error) bool

func OpenReader added in v0.9.4

func OpenReader(path string) (io.ReadCloser, error)

func OpenWriter

func OpenWriter(path string) (io.WriteCloser, error)

OpenWriter opens a fifo file for writer, assuming it already exists, returns io.WriteCloser

func Remove

func Remove(path string) error

Remove a fifo that already exists at a given path

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL