mirror of
https://github.com/go-micro/go-micro.git
synced 2025-11-23 21:44:41 +02:00
remove function
This commit is contained in:
17
micro.go
17
micro.go
@@ -30,18 +30,6 @@ 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
|
||||
}
|
||||
|
||||
// Event is used to publish messages to a topic
|
||||
type Event interface {
|
||||
// Publish publishes a message to the event topic
|
||||
@@ -69,11 +57,6 @@ 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...)
|
||||
}
|
||||
|
||||
// NewEvent creates a new event publisher
|
||||
func NewEvent(topic string, c client.Client) Event {
|
||||
if c == nil {
|
||||
|
||||
Reference in New Issue
Block a user