Categorygithub.com/dunv/concurrentList/v2
modulepackage
2.0.3
Repository: https://github.com/dunv/concurrentlist.git
Documentation: pkg.go.dev

# Functions

Constructor for creating a ConcurrentList (is required for initializing subscriber channels).
WithPersistence adds persistence in terms of "one file per item in the list" on the harddrive Whenever anything is added or removed a file with the json-marshaled contents is put into or removed from a directory.
WithSorting will automatically sort the contents of the list everytime an item is pushed according to the passed function WithSorting can also be used to create a priorityQueue.
WithTTL adds a time-to-live to every item in the list ATTENTION: Currently the user is required to add an attribute to every item which contains the timestamp of when it is added Required parameters are - ttl: how long will an item linger in the list until it is deleted automatically - ttlCheckInterval: in which interval are the ttl's of the items checked - ttlFunc: this func is called for every item in order to extract the timestamp of when it was added.

# Variables

ErrEmptyList is returned if one tries to get items from an empty list.

# Structs

ConcurrentList is a thread-safe datastructure which holds a list of items (interfaces{}) if desired these items can be automatically sorted or the list persisted on the HDD upon each change Any goroutine which calls GetNext() will block until an item is available (they are guaranteed to to continue in the same order GetNext() is called) or a passed context expires.

# Interfaces

No description provided by the author