client

package
v0.0.0-...-3e9ff4f Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferClient

type BufferClient struct {
	*Client

	Reply        chan *ReqReply
	GetClientKey func() int64
	// contains filtered or unexported fields
}

func NewBufferClient

func NewBufferClient(c *Client, reqNum, psize, conflict, writes int, conflictKey int64) *BufferClient

func (*BufferClient) Loop

func (c *BufferClient) Loop()

Assumed to be connected

func (*BufferClient) Pipeline

func (c *BufferClient) Pipeline(syncFreq int, window int32)

func (*BufferClient) Read

func (c *BufferClient) Read(key int64) []byte

func (*BufferClient) RegisterReply

func (c *BufferClient) RegisterReply(val state.Value, seqnum int32)

func (*BufferClient) Scan

func (c *BufferClient) Scan(key, count int64) []byte

func (*BufferClient) WaitReplies

func (c *BufferClient) WaitReplies(waitFrom int)

func (*BufferClient) Write

func (c *BufferClient) Write(key int64, val []byte)

type Client

type Client struct {
	*dlog.Logger

	ClientId  int32
	LeaderId  int
	ClosestId int // also co-located

	Ping []float64

	Fast       bool
	Verbose    bool
	Leaderless bool
	// contains filtered or unexported fields
}

func NewClient

func NewClient(server, maddr string, mport int, fast, leaderless, verbose bool) *Client

func NewClientLog

func NewClientLog(server, maddr string, mport int, fast, leaderless, verbose bool, logger *dlog.Logger) *Client

func (*Client) Connect

func (c *Client) Connect() error

func (*Client) Disconnect

func (c *Client) Disconnect()

func (*Client) GetReplyFrom

func (c *Client) GetReplyFrom(rid int) (*defs.ProposeReplyTS, error)

func (*Client) Reconnect

func (c *Client) Reconnect() error

func (*Client) RegisterRPCTable

func (c *Client) RegisterRPCTable(t *fastrpc.Table)

func (*Client) SendMsg

func (c *Client) SendMsg(rid int32, code uint8, msg fastrpc.Serializable)

For custom client messages

func (*Client) SendProposal

func (c *Client) SendProposal(cmd defs.Propose)

func (*Client) SendRead

func (c *Client) SendRead(key int64) int32

func (*Client) SendScan

func (c *Client) SendScan(key, count int64) int32

func (*Client) SendWrite

func (c *Client) SendWrite(key int64, value []byte) int32

type ReqReply

type ReqReply struct {
	Val    state.Value
	Seqnum int
	Time   time.Time
}

Jump to

Keyboard shortcuts

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