diff --git a/go-micro.go b/go-micro.go index dd982100..56c5630a 100644 --- a/go-micro.go +++ b/go-micro.go @@ -22,6 +22,18 @@ type Service interface { String() string } +// Function is a one time executing Service +type Function interface { + // Inherits Service interface + Service + // Done signals to complete execution + Done() error + // Handle registers an RPC handler + Handle(v interface{}) error + // Subscribe registers a subscriber + Subscribe(topic string, v interface{}) error +} + // Publisher is syntactic sugar for publishing type Publisher interface { Publish(ctx context.Context, msg interface{}, opts ...client.PublishOption) error