function interface

This commit is contained in:
Asim Aslam 2017-05-31 15:03:24 +01:00
parent a7312f5c7e
commit d5809d2d70

View File

@ -22,6 +22,18 @@ type Service interface {
String() string 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 // Publisher is syntactic sugar for publishing
type Publisher interface { type Publisher interface {
Publish(ctx context.Context, msg interface{}, opts ...client.PublishOption) error Publish(ctx context.Context, msg interface{}, opts ...client.PublishOption) error