An object-based Queue for iOS, tvOS and macOS, written in Swift.

Related tags

GCD Pillarbox
Overview

Pillarbox

Build Documentation

Pillarbox is an easy-to-use, object-based queue with support for iOS, tvOS and macOS, written purely in Swift. Push and pop operations are both in O(1). All writes are synchronous - this means data will be written to the disk before an operation returns. Furthermore, all operations are thread-safe and synchronized using a read-write lock. This allows for synchronized, concurrent access to read-operations while performing writes in serial.

About Pillarbox

Pillarbox was originally conceived as a simple object queue that allows to persist unsent messages locally in an efficient and simple way which outlasts app crashes and restarts. For its storage layer, Pillarbox makes use of Pinterest's excellent PINCache, which is a key/value store designed for persisting temporary objects on the disk. Beyond that, the Deque data structure from Apple's open source swift-collections library is used in the internal realization of the queue.

Installation

Pillarbox is available via the Swift Package Manager which is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system and automates the process of downloading, compiling, and linking dependencies.

Once you have your Swift package set up, adding Pillarbox as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(
        url: "https://github.com/aplr/Pillarbox.git",
        .upToNextMajor(from: "1.0.0")
    )
]

Usage

As a bare minimum, you have to specify the name of the Pillarbox which determines the queue file name, as well as the directory where the queue file is stored.

import Pillarbox

let url = URL(fileURLWithPath: "/path/to/your/app", isDirectory: true)

let pillarbox = Pillarbox<String>(name: "messages", url: url)

pillarbox.push("Hello")
pillarbox.push("World")

print(pillarbox.count)   // 2

print(pillarbox.pop())   // "Hello"
print(pillarbox.pop())   // "World"

print(pillarbox.isEmpty) // true

Going LIFO

Pillarbox uses a FIFO queue internally per default. If you want to change that behaviour to LIFO, pass a customized PillarboxConfiguration object with the strategy adjusted like below.

let url = URL(fileURLWithPath: "/path/to/your/app", isDirectory: true)

let configuration = PillarboxConfiguration(strategy: .lifo)

let pillarbox = Pillarbox<String>(
    name: "messages",
    url: url,
    configuration: configuration
)

// ...

Documentation

Documentation is available here and provides a comprehensive documentation of the library's public interface. Expect usage examples and guides to be added shortly.

License

Pillarbox is licensed under the MIT License.

iOS utility class to manage global dispatch queue.

YYDispatchQueuePool iOS utility class to manage global dispatch queue. (It's a component of YYKit) When use a concurrent queue to execute lots of bloc

null 453 Nov 13, 2021
async and await for Swift.

async and await for Swift. Usage Beta version. New docs soon... Contribute If you have any problems or need more information, please open an issue usi

null 90 Oct 28, 2020
Just a tiny library to make using GCD easier and intuitive

## Build Status Branch Status master develop Dispatch Note: Dispatch requires swift 3.0. Use version 1.0.0 for swift 2.3 or version 0.9.8 for swift 2.

João Mourato 180 Nov 14, 2021
Pretty GCD calls and easier code execution.

Threader Pretty GCD calls and easier code execution. Overview Threader makes GCD calls easy to read & write. It also provides a simple way to execute

Mitch Treece 36 Aug 28, 2020
Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch

Async Now more than syntactic sugar for asynchronous dispatches in Grand Central Dispatch (GCD) in Swift Async sugar looks like this: Async.userInitia

Tobias Due Munk 4.6k Nov 23, 2021
Grand Central Dispatch simplified with swift.

GCDKit GCDKit is Grand Central Dispatch simplified with Swift. for Swift 1.2: Use version 1.0.1 for Swift 2.1 / 2.2: Use the master branch Introductio

John Estropia 317 Nov 15, 2021
Well-tested GCD Timer in Swift

GCDTimer Well tested Grand Central Dispatch (GCD) Timer in Swift. Checkout the test file. Usage Long running timer import GCDTimer class Demo { in

Hemant Sapkota 182 Nov 8, 2021
Fast, non-deadlocking parallel object cache for iOS, tvOS and OS X

PINCache Fast, non-deadlocking parallel object cache for iOS and OS X. PINCache is a fork of TMCache re-architected to fix issues with deadlocking cau

Pinterest 2.5k Nov 24, 2021
Reflection based (Dictionary, CKRecord, NSManagedObject, Realm, JSON and XML) object mapping with extensions for Alamofire and Moya with RxSwift or ReactiveSwift

EVReflection General information At this moment the master branch is tested with Swift 4.2 and 5.0 beta If you want to continue using EVReflection in

Edwin Vermeer 964 Nov 30, 2021
Reflection based (Dictionary, CKRecord, NSManagedObject, Realm, JSON and XML) object mapping with extensions for Alamofire and Moya with RxSwift or ReactiveSwift

EVReflection General information At this moment the master branch is tested with Swift 4.2 and 5.0 beta If you want to continue using EVReflection in

Edwin Vermeer 963 Nov 21, 2021
💀Neither supported nor maintained for years. A type-safe, protocol-based, pure Swift database offering effortless persistence of any object

There are many libraries out there that aims to help developers easily create and use SQLite databases. Unfortunately developers still have to get bog

Øyvind Grimnes 493 Nov 23, 2021
A protocol-centric, type and queue safe key-value workflow.

Light-weight, strict protocol-first styled PropertyKit helps you to easily and safely handle guaranteed values, keys or types on various situations of

gitmerge 12 Feb 26, 2021
Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD).

Features • Requirements • Installing • Usage • Documentation • Changelog • Communication • Contributing • Author • License Features Queuer is a queue

Fabrizio Brancati 997 Nov 23, 2021
A real-time, votable, democratized music queue on iPad and iPhone using Spotify

Queue'd Music Queue'd is the best way to enjoy music with your friends. Add your favorite songs to a shared music queue at your favorite bars, restaur

Ryan Daulton 81 Nov 13, 2021
Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD).

Features • Requirements • Installing • Usage • Documentation • Changelog • Communication • Contributing • Author • License Features Queuer is a queue

Fabrizio Brancati 997 Nov 23, 2021
iOS utility class to manage global dispatch queue.

YYDispatchQueuePool iOS utility class to manage global dispatch queue. (It's a component of YYKit) When use a concurrent queue to execute lots of bloc

null 453 Nov 13, 2021
A Generic Priority Queue in Pure Swift

SwiftPriorityQueue SwiftPriorityQueue is a pure Swift (no Cocoa) implementation of a generic priority queue data structure, appropriate for use on all

David Kopec 339 Nov 7, 2021
A Task Queue Class developed in Swift (by Marin Todorov)

TaskQueue Table of Contents Intro Installation CocoaPods Carthage Simple Examples Synchronous tasks Asynchronous tasks Serial and Concurrent Tasks GCD

Marin Todorov 673 Aug 12, 2021
Queue management system for AVSpeechSynthesizer

QHSpeechSynthesizerQueue Queue management system for AVSpeechSynthesizer Installation Cocoapods Add this to your Podfile: pod 'QHSpeechSynthesizerQueu

Quentin Hayot 41 Aug 24, 2021
Physics-based animations for iOS, tvOS, and macOS.

Advance An animation library for iOS, tvOS, and macOS that uses physics-based animations (including springs) to power interactions that move and respo

Tim Donnelly 4.4k Nov 30, 2021
Simple JSON Object mapping written in Swift

ObjectMapper ObjectMapper is a framework written in Swift that makes it easy for you to convert your model objects (classes and structs) to and from J

Tristan Himmelman 8.9k Nov 23, 2021
Simple JSON Object mapping written in Swift

ObjectMapper ObjectMapper is a framework written in Swift that makes it easy for you to convert your model objects (classes and structs) to and from J

Tristan Himmelman 8.9k Nov 29, 2021
The #1 HTTP server for iOS, macOS & tvOS (also includes web based uploader & WebDAV server)

Overview GCDWebServer is a modern and lightweight GCD based HTTP 1.1 server designed to be embedded in iOS, macOS & tvOS apps. It was written from scr

Pierre-Olivier Latour 6k Nov 30, 2021
A swift and objective-C object that lets you add a background video to iOS views

BackgroundVideoiOS This is an Object/Class which lets you add a background video to iOS app views. This is seen at login views of some famous apps lik

Amro Gazlan 567 Nov 18, 2021
Matomo iOS, tvOS and macOS SDK: a Matomo tracker written in Swift

MatomoTracker (former PiwikTracker) iOS SDK The MatomoTracker is an iOS, tvOS and macOS SDK for sending app analytics to a Matomo server. MatomoTracke

Matomo Analytics 351 Nov 15, 2021
A small key-value data cache for iOS, macOS and tvOS, written in Swift.

Cachyr A typesafe key-value data cache for iOS, macOS, tvOS and watchOS written in Swift. There already exists plenty of cache solutions, so why creat

Norsk rikskringkasting (NRK) 120 Nov 10, 2021
A time and calendar manipulation library for iOS 9+, macOS 10.11+, tvOS 9+, watchOS 2+ written in Swift 4.

SwiftMoment This framework is inspired by Moment.js. Its objectives are the following: Simplify the manipulation and readability of date and interval

Adrian Kosmaczewski 1.6k Nov 23, 2021
A sound fader for AVAudioPlayer written in Swift for iOS, tvOS and macOS.

Cephalopod, a sound fader for AvAudioPlayer written in Swift - iOS, tvOS and macOS This library can help fading sounds in and out with AvAudioPlayer.

Evgenii Neumerzhitckii 105 Nov 18, 2021
An image download extension of the image view written in Swift for iOS, tvOS and macOS.

Moa, an image downloader written in Swift for iOS, tvOS and macOS Moa is an image download library written in Swift. It allows to download and show an

Evgenii Neumerzhitckii 327 Oct 29, 2021