prysm-pulse/sharding/interfaces.go
Raul Jordan 49dc0dc4a5 sharding: fixed main entry point, linter errors
Former-commit-id: 705e95b849818683ab610b80f101278e6241b4d6 [formerly 925da4e8a6ef6d8e9d82ba9073666c2a26cd6c77]
Former-commit-id: a43a26be717cb63a0a8c03165e865d875ca11ed4
2018-05-22 07:47:35 -05:00

25 lines
817 B
Go

package sharding
import (
cli "gopkg.in/urfave/cli.v1"
)
// Service defines items that can be registered into a sharding client.
//
// life-cycle management is delegated to the sharding client. The service is allowed to
// initialize itself upon creation, but no goroutines should be spun up outside of the
// Start method.
type Service interface {
// Start is called after all services have been constructed and the networking
// layer was also initialized to spawn any goroutines required by the service.
Start() error
// Stop terminates all goroutines belonging to the service, blocking until they
// are all terminated.
Stop() error
}
// ServiceConstructor defines the callback passed in when registering a service
// to a sharding node.
type ServiceConstructor func(ctx *cli.Context) (Service, error)