1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-12 22:07:47 +02:00

Add pub/sub to client/server and make broker more low level

This commit is contained in:
Asim
2015-06-12 19:52:27 +01:00
parent cdf2f2cbcd
commit b91af916f9
24 changed files with 542 additions and 193 deletions

View File

@ -4,6 +4,7 @@ import (
log "github.com/golang/glog"
"github.com/myodc/go-micro/cmd"
"github.com/myodc/go-micro/examples/server/handler"
"github.com/myodc/go-micro/examples/server/subscriber"
"github.com/myodc/go-micro/server"
)
@ -23,6 +24,21 @@ func main() {
),
)
// Register Subscribers
server.Subscribe(
server.NewSubscriber(
"topic.go.micro.srv.example",
new(subscriber.Example),
),
)
server.Subscribe(
server.NewSubscriber(
"topic.go.micro.srv.example",
subscriber.Handler,
),
)
// Run server
if err := server.Run(); err != nil {
log.Fatal(err)