Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoAckMessage ¶
type AutoAckMessage struct {
// contains filtered or unexported fields
}
func (*AutoAckMessage) Do ¶
func (a *AutoAckMessage) Do(doFunc DoFunc) error
type DelayActor ¶
type DelayActor struct { *timingwheel.TimingWheel time.Duration // contains filtered or unexported fields }
DelayActor take an timingwheel and use it for its own delay setting.
func NewDelayActor ¶
func NewDelayActor(msg Visitor, timingWheel *timingwheel.TimingWheel) *DelayActor
func (DelayActor) Do ¶
func (d DelayActor) Do(doFunc DoFunc) error
type FailedHandler ¶
type Middleware ¶
Below middleware code from go-kit visitor. https://github.com/go-kit/kit/blob/master/endpoint/endpoint.go
func Chain ¶
func Chain(outer Middleware, others ...Middleware) Middleware
Chain is a helper function for composing middlewares. Requests will traverse them in the order they're declared. That is, the first middleware is treated as the outermost middleware.
func WithRetry ¶
func WithRetry(retryTimes int) Middleware
type NameVisitor ¶
type NameVisitor struct {
Name string
}
func (*NameVisitor) Do ¶
func (nop *NameVisitor) Do(fn DoFunc) error
type RetryActor ¶
Example ¶
Actor := NewRetryMessage(&Message{}) // Publish: warning: this publisher only pub protocol to stdout, so example does not work in real world. publish := func(ctx context.Context, r interface{}) error { log.Println("this pre log to console: ", ctx, r) defer log.Println("this post log to console: ", ctx, r) return nil } err := Actor.Do(publish) log.Println(err)
func NewRetryMessage ¶
func NewRetryMessage(msg Visitor) *RetryActor
func (*RetryActor) Do ¶
func (m *RetryActor) Do(fn DoFunc) error
func (*RetryActor) NoRetry ¶
func (m *RetryActor) NoRetry(err error) bool
IfRetry(err), when err == nil, not retry is true. Then check for m.noRetryErr slice. If you set error no need to retry.
Click to show internal directories.
Click to hide internal directories.