leozz37/hare

View on GitHub
examples/listen.go

Summary

Maintainability
A
0 mins
Test Coverage
package main

import (
    "fmt"

    "github.com/leozz37/hare"
)

func main() {
    r, err := hare.Listen("3000")
    if err != nil {
        panic(err)
    }

    for {
        if r.HasNewMessages() {
            fmt.Println(r.GetMessage())
        }
    }
}