Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/siadat/ipc
Pure Go wrapper for System V message queue
https://github.com/siadat/ipc
go golang message-queue system-v
Last synced: 13 days ago
JSON representation
Pure Go wrapper for System V message queue
- Host: GitHub
- URL: https://github.com/siadat/ipc
- Owner: siadat
- License: mit
- Created: 2017-08-12T20:09:38.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-09-02T21:22:01.000Z (about 3 years ago)
- Last Synced: 2024-10-12T12:43:05.727Z (29 days ago)
- Topics: go, golang, message-queue, system-v
- Language: Go
- Homepage:
- Size: 33.2 KB
- Stars: 71
- Watchers: 7
- Forks: 18
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.MIT
Awesome Lists containing this project
README
# System V message queue IPC functions
Wrapper functions for System V Message Queue IPC.
[![GoDoc](https://godoc.org/github.com/siadat/ipc?status.svg)](https://godoc.org/github.com/siadat/ipc)
[![Build Status](https://travis-ci.org/siadat/ipc.svg?branch=master)](https://travis-ci.org/siadat/ipc)## Example
```go
package mainimport (
"log"
"syscall""github.com/siadat/ipc"
)func main() {
key, err := ipc.Ftok("/dev/null", 42)
if err != nil {
panic(err)
}qid, err := ipc.Msgget(key, ipc.IPC_CREAT|ipc.IPC_EXCL|0600)
if err == syscall.EEXIST {
log.Fatalf("queue(key=0x%x) exists", key)
}
if err != nil {
log.Fatal(err)
}msg := &ipc.Msgbuf{Mtype: 12, Mtext: []byte("message")}
err = ipc.Msgsnd(qid, msg, 0)
if err != nil {
log.Fatal(err)
}
}
```