deck

package module
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

deck

Task class memory-level queue processing.

Installation

go get -u github.com/coolstina/deck

Feature

  • Enqueue based on task ID
  • Iteratively get queue data(Support custom data persistence)
  • Check if task queue data exists
  • Check task queue length
  • Get the task list

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decker

type Decker interface {
	Enqueue(taskId int, values ...interface{}) Effected
	Exists(taskId int) bool
	Values(taskId int) *list.List
	Len(taskId int) int
	FetchOrStorage(ctx context.Context, taskId int, ops ...Option) <-chan interface{}
}

func NewDecker

func NewDecker(showLogger bool) Decker

type Effected

type Effected struct {
	TaskId  int
	Already int
	Newness int
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

type OptionFunc

type OptionFunc func(option *option)

func WithInterval

func WithInterval(interval time.Duration) OptionFunc

func WithReceiveDoneNotification added in v1.1.2

func WithReceiveDoneNotification(receive bool) OptionFunc

func WithStorage

func WithStorage(storage Storage) OptionFunc

type Storage

type Storage func(value interface{})

Storage custom storage queue data to same store, filesystem, redis and so on.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL