Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildJobExecutionLockKey ¶
BuildJobExecutionLockKey builds a lock key for a job execution. The key is used to lock a job execution to prevent concurrent update job execution.
func BuildJobRequestLockKey ¶
BuildJobRequestLockKey builds a lock key for a job request. The key is used to lock a job request to prevent multiple requests for the same job execution. Server keeps the lock for a period, and waits the agent to pick up the job execution. The job request process is a 2 phase commit process. Phase 1 is to lock the job request, and phase 2 is to really get the job execution.
Types ¶
type DAG ¶
type DAG[T Node] struct { // contains filtered or unexported fields }
DAG uses topological sort to build a directed acyclic graph.
type Locker ¶
type Locker interface { // Lock tries to lock a key with the given value for a period. // It returns whether locking was successful and whether an error occurred. Lock(ctx context.Context, key, value string, expiresIn time.Duration) (bool, error) // Unlock tries to unlock a key. It only succeeds if the value matches. Unlock(ctx context.Context, key string) (bool, error) }
type ProtobufTypeExtension ¶
type ProtobufTypeExtension struct {
jsoniter.DummyExtension
}
func (*ProtobufTypeExtension) CreateDecoder ¶
func (e *ProtobufTypeExtension) CreateDecoder(typ reflect2.Type) jsoniter.ValDecoder
func (*ProtobufTypeExtension) CreateEncoder ¶
func (e *ProtobufTypeExtension) CreateEncoder(typ reflect2.Type) jsoniter.ValEncoder
type RingBuffer ¶
type RingBuffer struct {
// contains filtered or unexported fields
}
RingBuffer is a ring buffer with a Close() method.
func NewRingBuffer ¶
func NewRingBuffer(size int) *RingBuffer
NewRingBuffer creates a new ring buffer with given size.