rpc

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TaskToProto

func TaskToProto(task *bokchoy.Task) *proto.Task

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(addr string, options ClientOptions) *Client

NewClient initializes a new rpc client.

func (*Client) PublishTask

func (c *Client) PublishTask(ctx context.Context, queueName string, payload []byte) (*proto.Task, error)

type ClientOptions

type ClientOptions struct {
	MaxRetries      uint
	PerRetryTimeout time.Duration
	RetryCodes      []codes.Code
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func (Handler) PublishTask

func (h Handler) PublishTask(ctx context.Context, req *proto.PublishTaskRequest) (*proto.Task, error)

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a rpc server which contains gRPC.

func NewServer

func NewServer(bok *bokchoy.Bokchoy, port int) *Server

NewServer initializes a new Server.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start starts the RPC server.

func (*Server) Stop

func (s *Server) Stop(ctx context.Context)

Stop stops the RPC server.

func (*Server) String

func (s *Server) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL