Skip to content

mbcrocci/queue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

queue

A fast, thread safe, queue implementation

Usage

package main

import "github.com/mbcrocci/queue"

type MyStruct struct {
  i int
  s string 
}

func main() {
  // initialize the queue
  q := queue.New[MyStruct]()

  ms := &MyStruct{}

  // Enqueue to the queue. If there is a consumer blocked reading 
  // it will unlock.
  q.Enqueue(ms)
  
  // Dequeue from the queue (blocking)
  s := q.Dequeue()
}

About

A fast, thread safe, queue implementation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages