func (i *InmemTransport) SetHeartbeatHandler(cb func(RPC)) {
}
SetHeartbeatHandler is used to set optional fast-path for
heartbeats, not supported for this transport.
package raft
import (
	"fmt"
	"io"
	"net"
	"sync"
	"time"
)
type InmemAddr struct {
	ID string
}
func NewInmemAddr() *InmemAddr {
	return &InmemAddr{generateUUID()}
}
func (ia *InmemAddr) Network() string {
	return "inmem"
}
func (ia *InmemAddr) String() string {
	return ia.ID
}
type inmemPipeline struct {
	trans    *InmemTransport
	peer     *InmemTransport
	peerAddr string
	doneCh       chan AppendFuture
	inprogressCh chan *inmemPipelineInflight
	shutdown     bool
	shutdownCh   chan struct{}
	shutdownLock sync.Mutex
}
type inmemPipelineInflight struct {
	future *appendFuture
	respCh <-chan RPCResponse
}
type InmemTransport struct {
	sync.RWMutex
	consumerCh chan RPC
	localAddr  *InmemAddr
	peers      map[string]*InmemTransport
	pipelines  []*inmemPipeline
	timeout    time.Duration
}
func NewInmemTransport() (*InmemAddr, *InmemTransport) {
	addr := NewInmemAddr()
	trans := &InmemTransport{
		consumerCh: make(chan RPC, 16),
		localAddr:  addr,
		peers:      make(map[string]*InmemTransport),
		timeout:    50 * time.Millisecond,
	}
	return addr, trans
}