{"id":13584111,"url":"https://github.com/linkedin/cassette","last_synced_at":"2025-08-17T01:34:51.752Z","repository":{"id":33139502,"uuid":"36779168","full_name":"linkedin/cassette","owner":"linkedin","description":"An efficient, file-based FIFO Queue for iOS and macOS.","archived":false,"fork":false,"pushed_at":"2024-09-26T04:41:58.000Z","size":473,"stargazers_count":95,"open_issues_count":10,"forks_count":17,"subscribers_count":43,"default_branch":"master","last_synced_at":"2025-07-17T01:49:47.646Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linkedin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-03T04:06:27.000Z","updated_at":"2024-11-28T16:31:11.000Z","dependencies_parsed_at":"2025-04-06T22:32:12.734Z","dependency_job_id":"711ac7a4-fc79-4811-974f-b8d9f424833d","html_url":"https://github.com/linkedin/cassette","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/linkedin/cassette","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkedin%2Fcassette","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkedin%2Fcassette/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkedin%2Fcassette/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkedin%2Fcassette/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkedin","download_url":"https://codeload.github.com/linkedin/cassette/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkedin%2Fcassette/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270701820,"owners_count":24630868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T15:04:01.124Z","updated_at":"2025-08-17T01:34:51.693Z","avatar_url":"https://github.com/linkedin.png","language":"Objective-C","funding_links":[],"categories":["Objective-C"],"sub_categories":[],"readme":"[![Build Status](https://dev.azure.com/lnkd-oss/cassette/_apis/build/status/linkedin.cassette?branchName=master)](https://dev.azure.com/lnkd-oss/cassette/_build/latest?definitionId=4\u0026branchName=master)\n\n# Cassette \n\nCassette is a collection of queue-related classes for iOS and macOS. It is maintained by [LinkedIn](https://engineering.linkedin.com/). Cassette was originally implemented by [Segment](https://segment.com). Cassette was inspired by [Tape](https://github.com/square/tape).\n\n`QueueFile` is an efficient, file-based FIFO queue. Addition and removal from an instance is an O(1) operation. Writes are synchronous; data will be written to disk before an operation returns. The queue is intended to be reliable and survive system or process crashes.\n\n## Installing the Library\n\n#### CocoaPods\n```\ntarget 'MyApp' do\n  pod 'Cassette', '1.0.0-beta3'\nend\n```\n\n#### Manual\nDownload the [latest binary](https://github.com/linkedin/cassette/releases) of the library.\n\n## Usage\n`CASObjectQueue` works with arbitrary objects that abide by the [NSCoding](https://developer.apple.com/documentation/foundation/nscoding?language=objc) protocol. An `CASObjectQueue` may be backed by a persistent `CASQueueFile`, or in memory. \n\n```\nCASObjectQueue\u003cNSNumber *\u003e *queue;\n\n// Persistent ObjectQueue\nNSError *error;\nqueue = [[CASFileObjectQueue alloc] initWithRelativePath:@\"Test-File\" error:\u0026error];\n\n// In-Memory ObjectQueue\nqueue = [[CASInMemoryObjectQueue alloc] init];\n```\n\nAdd some data to the end of the queue.\n```\nNSError *error;\nif ([queue add:@1 error:\u0026error]) {\n  // Success\n} else {\n  NSLog(@\"Error: %@\", error);\n}\n```\n\nRead data at the head of the queue.\n```\n// Peek the eldest element. Note that -peek:error: on an empty queue\n// returns @[], but on error (e.g., I/O error) it returns nil.\nNSNumber *data = [queue peek:1 error:\u0026error].firstObject;\n\n// Peek the eldest `n` elements.\nNSArray\u003cNSNumber *\u003e *data = [queue peek:n error:\u0026error];\n```\n\nRemove processed elements.\n```\n// Remove the eldest element.\nif ([queue pop:1 error:\u0026error]) { ... }\n\n// Remove 'n' elements.\nif ([queue pop:n error:\u0026error]) { ... }\n\n// Remove all elements.\nif ([queue clearAndReturnError:\u0026error]) { ... }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkedin%2Fcassette","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkedin%2Fcassette","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkedin%2Fcassette/lists"}