2019-04-09 15:07:46 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"./pipeio"
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
pipeio, err := pipeio.NewPipeIO("in", "out")
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
defer pipeio.Close()
|
|
|
|
|
2019-04-11 16:30:25 +00:00
|
|
|
pipeio.Reader.SetMessageHandler(func(msg []byte) {
|
2019-04-09 15:07:46 +00:00
|
|
|
pipeio.Writer.SendMessage(msg)
|
|
|
|
})
|
2019-04-11 16:30:25 +00:00
|
|
|
pipeio.Reader.Run()
|
2019-04-09 15:07:46 +00:00
|
|
|
}
|