Skip to content

DQue should be an Interface #34

@nfoerster

Description

@nfoerster

Although the current state works great, think about changing DQue as the return of New() to an interface. This makes it much easier for testing purposes. A dummy implementation of the interface would avoid any write/lock implications during testing.

type DQue interface {
  Close() error
  Enqueue(obj interface{}) error
  Dequeue() (interface{}, error)
  Peek() (interface{}, error)
  DequeueBlock() (interface{}, error)
  PeekBlock() (interface{}, error)
  Size() int
  SizeUnsafe() int
  SegmentNumbers() (int, int)
  Turbo() bool
  TurboOn() error
  TurboOff() error
  TurboSync() error
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions