mirror of
https://github.com/luxfi/node.git
synced 2026-07-27 03:39:39 +00:00
29 lines
707 B
Go
29 lines
707 B
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package throttling
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/luxfi/ids"
|
|
)
|
|
|
|
var _ InboundMsgThrottler = (*noInboundMsgThrottler)(nil)
|
|
|
|
// Returns an InboundMsgThrottler where Acquire() always returns immediately.
|
|
func NewNoInboundThrottler() InboundMsgThrottler {
|
|
return &noInboundMsgThrottler{}
|
|
}
|
|
|
|
// [Acquire] always returns immediately.
|
|
type noInboundMsgThrottler struct{}
|
|
|
|
func (*noInboundMsgThrottler) Acquire(context.Context, uint64, ids.NodeID) ReleaseFunc {
|
|
return noopRelease
|
|
}
|
|
|
|
func (*noInboundMsgThrottler) AddNode(ids.NodeID) {}
|
|
|
|
func (*noInboundMsgThrottler) RemoveNode(ids.NodeID) {}
|