# goeventbus **Repository Path**: oyuer/goeventbus ## Basic Information - **Project Name**: goeventbus - **Description**: sssssssssssssss - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-07-24 - **Last Updated**: 2023-07-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## What a simple event bus in golang ## Use ```golang bus := NewBus() sub := NewSub() bus.Subscribe("topic1", sub) go func() { msg := sub.Out().(int) if msg != 7 { t.Fatalf("got wrong number:%d", msg) } }() bus.Publish("topic1", 7) // or use PubFunc to publish to a certain topic pubFunc := bus.PubFunc("topic1") pubFunc(7) ``` For more details,see [testfile](https://github.com/Jun10ng/goeventbus/blob/master/bus_test.go)