Add pub/sub to client/server and make broker more low level
This commit is contained in:
18
examples/server/subscriber/subscriber.go
Normal file
18
examples/server/subscriber/subscriber.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package subscriber
|
||||
|
||||
import (
|
||||
log "github.com/golang/glog"
|
||||
example "github.com/myodc/go-micro/examples/server/proto/example"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
type Example struct{}
|
||||
|
||||
func (e *Example) Handle(ctx context.Context, msg *example.Message) error {
|
||||
log.Info("Handler Received message: ", msg.Say)
|
||||
return nil
|
||||
}
|
||||
|
||||
func Handler(msg *example.Message) {
|
||||
log.Info("Function Received message: ", msg.Say)
|
||||
}
|
Reference in New Issue
Block a user