package rafthttp
import "github.com/coreos/etcd/rafthttp"
Index ¶
- Constants
- Variables
- func NewHandler(p Processor, cid types.ID) http.Handler
- func NewSender(tr http.RoundTripper, u string, cid types.ID, p Processor, fs *stats.FollowerStats, shouldstop chan struct{}) *sender
- func NewStreamHandler(finder SenderFinder, id, cid types.ID) http.Handler
- type Batcher
- func NewBatcher(n int, d time.Duration) *Batcher
- func (b *Batcher) Reset(t time.Time)
- func (b *Batcher) ShouldBatch(now time.Time) bool
- type Processor
- type Sender
- type SenderFinder
- type WriteFlusher
Constants ¶
const (
ConnReadLimitByte = 64 * 1024
)
Variables ¶
Functions ¶
func NewHandler ¶
func NewSender ¶
func NewSender(tr http.RoundTripper, u string, cid types.ID, p Processor, fs *stats.FollowerStats, shouldstop chan struct{}) *sender
func NewStreamHandler ¶
func NewStreamHandler(finder SenderFinder, id, cid types.ID) http.Handler
NewStreamHandler returns a handler which initiates streamer when receiving stream request from follower.
Types ¶
type Batcher ¶
type Batcher struct {
// contains filtered or unexported fields
}
func NewBatcher ¶
func (*Batcher) Reset ¶
func (*Batcher) ShouldBatch ¶
type Processor ¶
type Sender ¶
type Sender interface { // StartStreaming enables streaming in the sender using the given writer, // which provides a fast and effecient way to send appendEntry messages. StartStreaming(w WriteFlusher, to types.ID, term uint64) (done <-chan struct{}, err error) Update(u string) // Send sends the data to the remote node. It is always non-blocking. // It may be fail to send data if it returns nil error. Send(m raftpb.Message) error // Stop performs any necessary finalization and terminates the Sender // elegantly. Stop() }
type SenderFinder ¶
type SenderFinder interface { // Sender returns the sender of the given id. Sender(id types.ID) Sender }
type WriteFlusher ¶
Source Files ¶
batcher.go entry_reader.go entry_writer.go http.go sender.go streamer.go
- Version
- v0.5.0-alpha.4
- Published
- Nov 26, 2014
- Platform
- darwin/amd64
- Imports
- 19 packages
- Last checked
- 3 minutes ago –
Tools for package owners.