1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-11-23 21:44:41 +02:00

working function solution

This commit is contained in:
Asim Aslam
2017-05-31 20:45:36 +01:00
parent 0f1ec6ea0f
commit 3e9f556e4a
2 changed files with 72 additions and 0 deletions

View File

@@ -61,6 +61,11 @@ func NewContext(ctx context.Context, s Service) context.Context {
return context.WithValue(ctx, serviceKey{}, s)
}
// NewFunction returns a new Function for a one time executing Service
func NewFunction(opts ...Option) Function {
return newFunction(opts...)
}
// NewPublisher returns a new Publisher
func NewPublisher(topic string, c client.Client) Publisher {
if c == nil {