{"modulePath":"github.com/infinitbyte/framework","version":"v1.1.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package mem_queue\n\nPackage queue implements a double-ended queue (aka \"deque\") data structure on top of a slice. All operations run in (amortized) constant time. Benchmarks compare favorably to container/list as well as to Go's channels. These queues are not safe for concurrent use.\n\n## Types\n\n```go\ntype MemoryQueue struct {\n\tCapacity uint32 `config:\"capacity\"`\n\tDefault  bool   `config:\"default\"`\n\tEnabled  bool   `config:\"enabled\"`\n\n\tMemorySize int `config:\"total_memory_size\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (this *MemoryQueue) Close(string) error\n```\n\n```go\nfunc (this *MemoryQueue) Consume(q *queue.QueueConfig, consumer *queue.ConsumerConfig, offsetStr string) (*queue.Context, []queue.Message, bool, error)\n```\n\n```go\nfunc (this *MemoryQueue) Depth(q string) int64\n```\n\n```go\nfunc (this *MemoryQueue) GetQueues() []string\n```\n\n```go\nfunc (this *MemoryQueue) Init(q string) error\n```\n\n```go\nfunc (this *MemoryQueue) LatestOffset(string) string\n```\n\n```go\nfunc (this *MemoryQueue) Name() string\n```\n\n```go\nfunc (this *MemoryQueue) Pop(q string, t time.Duration) (data []byte, timeout bool)\n```\n\n```go\nfunc (this *MemoryQueue) Push(q string, data []byte) error\n```\n\n```go\nfunc (this *MemoryQueue) Setup()\n```\n\n```go\nfunc (this *MemoryQueue) Start() error\n```\n\n```go\nfunc (this *MemoryQueue) Stop() error\n```\n\n```go\ntype Queue struct {\n\t// contains filtered or unexported fields\n}\n```\nQueue represents a double-ended queue. The zero value is an empty queue ready to use.\n\n```go\nfunc New() *Queue\n```\nNew returns an initialized empty queue.\n\n```go\nfunc (q *Queue) Back() interface{}\n```\nBack returns the last element of queue q or nil.\n\n```go\nfunc (q *Queue) Front() interface{}\n```\nFront returns the first element of queue q or nil.\n\n```go\nfunc (q *Queue) Init() *Queue\n```\nInit initializes or clears queue q.\n\n```go\nfunc (q *Queue) Len() int\n```\nLen returns the number of elements of queue q.\n\n```go\nfunc (q *Queue) PopBack() interface{}\n```\nPopBack removes and returns the last element of queue q or nil.\n\n```go\nfunc (q *Queue) PopFront() interface{}\n```\nPopFront removes and returns the first element of queue q or nil.\n\n```go\nfunc (q *Queue) PushBack(v interface{})\n```\nPushBack inserts a new value v at the back of queue q.\n\n```go\nfunc (q *Queue) PushFront(v interface{})\n```\nPushFront inserts a new value v at the front of queue q.\n\n```go\nfunc (q *Queue) String() string\n```\nString returns a string representation of queue q formatted from front to back.\n\n","path":"github.com/infinitbyte/framework/modules/queue/mem_queue","name":"mem_queue","synopsis":"Package queue implements a double-ended queue (aka \"deque\") data structure on top of a slice.","isRedistributable":true}
