Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClusterConnection ¶
type ClusterConnection struct { DiscoveryService DiscoveryService State ClusterState // contains filtered or unexported fields }
ClusterConnection represents a connection to a cluster, and contains information such as the cluster membership list
func NewClusterConnection ¶
func NewClusterConnection(dService DiscoveryService) *ClusterConnection
NewClusterConnection creates a new ClusterConnection. It does not connect to the cluster before Connect() is called.
func (*ClusterConnection) Connect ¶
func (cluster *ClusterConnection) Connect() error
Connect connects the current node to the cluster, that is, it registers the node and starts listening for memebership updates.
func (*ClusterConnection) Disconnect ¶
func (cluster *ClusterConnection) Disconnect() error
Disconnect removes this node from the cluster. Notice that it is not necesarraily unregistered immediately, depending on the discovery service implementation.
func (*ClusterConnection) FindNodeForKey ¶
func (cluster *ClusterConnection) FindNodeForKey(key string) ([]ServingService, error)
FindNodeForKey returns a node that can handle the model specified by the given key.
type ClusterState ¶
type ClusterState int
ClusterState represents the current state of the node
const ( // ClusterStateReady represents that the node is ready to connect to cluster ClusterStateReady ClusterState = iota // ClusterStateStarted represents that the node is connected to cluster ClusterStateStarted )
func (*ClusterState) String ¶
func (state *ClusterState) String() string
type DiscoveryService ¶
type DiscoveryService interface { AddNodeListUpdated(string, chan []ServingService) RemoveNodeListUpdated(string) RegisterService() error UnregisterService() error }
DiscoveryService is a service discovery provider. It has the responsibility to discover other ServingServices and to register itself on the network.
type ServingService ¶
ServingService contains network information of a service that provides TF Serving
func (*ServingService) String ¶
func (service *ServingService) String() string
type TaskHandler ¶
type TaskHandler struct { Cluster *ClusterConnection RestProxy *tfservingproxy.RestProxy GrpcProxy *tfservingproxy.GrpcProxy // contains filtered or unexported fields }
TaskHandler handles TFServing jobs. A TaskHandler is usually associated with one TFServing server, e.g. as a sidecar.
func NewTaskHandler ¶
func NewTaskHandler(dService DiscoveryService) *TaskHandler
NewTaskHandler creates a new TaskHandler
func (*TaskHandler) Close ¶
func (handler *TaskHandler) Close() error
func (*TaskHandler) ConnectToCluster ¶
func (handler *TaskHandler) ConnectToCluster() error
ConnectToCluster makes this TaskHandler discoverable in the cluster and starts listening for other members
func (*TaskHandler) DisconnectFromCluster ¶
func (handler *TaskHandler) DisconnectFromCluster() error
DisconnectFromCluster disconnects the TaskHandler from the cluster (eventually)
func (*TaskHandler) ServeRest ¶
func (handler *TaskHandler) ServeRest() func(http.ResponseWriter, *http.Request)
ServeRest returns a function for HTTP serving