Skip to content

agileone/mailbox

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mailbox GoDoc Status

mailbox a send and receive library, it's simple with few frills.

Benchmarks

BenchmarkMailbox-4              20000000            85.7 ns/op         8 B/op      1 allocs/op
BenchmarkChannel-4              10000000           175 ns/op           8 B/op      1 allocs/op
BenchmarkBatchMailbox-4           100000         14272 ns/op           0 B/op      0 allocs/op
BenchmarkBatchChannel-4            20000         66022 ns/op           0 B/op      0 allocs/op

Usage

package main

import (
        "fmt"

        "github.com/itsmontoya/mailbox"
)

func main() {
        mb := mailbox.New(32)

        go func() {
                mb.Send("Hello world!")
                mb.Close()
        }()

        mb.Listen(func(msg interface{}) (end bool) {
                fmt.Println(msg)
                return
        })
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%