Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/yasushi-saito/fifo_queue

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/yasushi-saito/fifo_queue

  • v0.0.0-20120615152523-7bded5a7c11d
  • Source
  • Go
  • Socket score

Version published
Created
Source

fifo_queue.Queue is a simple FIFO queue. It supports pushing an item at the end, and popping an item from the front. It is implemented as a single-linked list of arrays of items.

INSTALLATION

go get github.com/yasushi-saito/fifo_queue

EXAMPLE:

import "github.com/yasushi-saito/fifo_queue"
q := fifo_queue.NewQueue()
q.PushBack("foo")
q.PushBack("bar")
item := q.PopFront().(string)  // "foo"
item = q.PopFront().(string)   // "bar"

TYPES

type Item interface{}

type Queue struct { // contains filtered or unexported fields }

func NewQueue() *Queue Create a new empty FIFO queue

func (q *Queue) Len() int Return the number of items in the queue

func (q *Queue) PopFront() Item Remove the item at the head of the queue and return it.

REQUIRES: q.Len() > 0

func (q *Queue) PushBack(item Item) Add an item to the end of the queue

FAQs

Package last updated on 15 Jun 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc