{"id":15561319,"url":"https://github.com/swiftnioextras/swift-nio-redis","last_synced_at":"2025-04-23T22:41:41.005Z","repository":{"id":63921071,"uuid":"128996385","full_name":"SwiftNIOExtras/swift-nio-redis","owner":"SwiftNIOExtras","description":"A high performance Redis protocol (RESP) implementation for SwiftNIO","archived":false,"fork":false,"pushed_at":"2024-01-29T23:05:56.000Z","size":102,"stargazers_count":30,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-03-24T14:39:26.357Z","etag":null,"topics":["asyncio","redis","redis-client","swift-framework","swift-nio","swift-server","swift4"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SwiftNIOExtras.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","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":"2018-04-10T21:21:35.000Z","updated_at":"2024-10-15T00:13:50.000Z","dependencies_parsed_at":"2025-03-06T18:33:26.535Z","dependency_job_id":"7971aa50-d060-4553-a0e8-537e26901847","html_url":"https://github.com/SwiftNIOExtras/swift-nio-redis","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftNIOExtras%2Fswift-nio-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftNIOExtras%2Fswift-nio-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftNIOExtras%2Fswift-nio-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftNIOExtras%2Fswift-nio-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SwiftNIOExtras","download_url":"https://codeload.github.com/SwiftNIOExtras/swift-nio-redis/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250528681,"owners_count":21445511,"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","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":["asyncio","redis","redis-client","swift-framework","swift-nio","swift-server","swift4"],"created_at":"2024-10-02T16:07:25.287Z","updated_at":"2025-04-23T22:41:40.987Z","avatar_url":"https://github.com/SwiftNIOExtras.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftNIO Redis\n\n![Swift5](https://img.shields.io/badge/swift-5-blue.svg)\n![macOS](https://img.shields.io/badge/os-macOS-green.svg?style=flat)\n![tuxOS](https://img.shields.io/badge/os-tuxOS-green.svg?style=flat)\n![Travis](https://travis-ci.org/SwiftNIOExtras/swift-nio-redis.svg?branch=develop)\n\nSwiftNIO Redis is a Swift package that contains a high performance \n[Redis protocol](https://redis.io/topics/protocol)\nimplementation for\n[SwiftNIO](https://github.com/apple/swift-nio).\nThis is a **standalone project** and has no other dependencies but\n[SwiftNIO](https://github.com/apple/swift-nio).\n\nApart from the protocol implementation which can encode and decode\n[RESP](https://redis.io/topics/protocol) (REdis Serialization Protocol),\nwe also provide a [Redis client module](https://github.com/NozeIO/swift-nio-redis-client)\nbuild on top.\n\nWhat is Redis?\n[Redis](https://redis.io/) is a highly scalable in-memory data structure store,\nused as a database, cache and message broker.\nFor example it can be used to implement a session store backing a web backend\nusing its \"expiring keys\" feature,\nor it can be used as a relay to implement a chat server using its builtin\n[PubSub](https://redis.io/topics/pubsub)\nfeatures.\n\nThis Swift package includes the RESP protocol implementation.\nA simple Redis client can be found on\n[swift-nio-redis-client](https://github.com/NozeIO/swift-nio-redis-client).\nWe also provide an actual [Redis Server](https://github.com/NozeIO/redi-s)\nwritten in Swift, using SwiftNIO and SwiftNIO Redis.\n\n\n## Performance\n\nThis implementation is focused on performance.\nIt tries to reuse NIO `ByteBuffer`s as much as possible to avoid copies.\n\nThe parser is based on a state machine, not on a buffering\n`ByteToMessageDecoder`/Encoder.\nThat doesn't make it nice, but efficient ;-)\n\n## Importing the module using Swift Package Manager\n\nAn example `Package.swift `importing the necessary modules:\n\n```swift\n// swift-tools-version:5.0\n\nimport PackageDescription\n\nlet package = Package(\n    name: \"RedisTests\",\n    dependencies: [\n        .package(url: \"https://github.com/SwiftNIOExtras/swift-nio-redis.git\", \n                 from: \"0.9.2\")\n    ],\n    targets: [\n        .target(name: \"MyProtocolTool\",\n                dependencies: [ \"NIORedis\" ])\n    ]\n)\n```\n\n\n## Using the SwiftNIO Redis protocol handler\n\nThe RESP protocol is implemented as a regular\n`ChannelHandler`, similar to `NIOHTTP1`.\nIt takes incoming `ByteBuffer` data, parses that, and emits `RESPValue`\nitems.\nSame the other way around, the user writes `RESPValue` (or `RESPEncodable`)\nobjects, and the handler renders such into `ByteBuffer`s.\n\nThe [NIORedis module](Sources/NIORedis/README.md) has a litte more\ninformation.\n\nTo add the RESP handler to a NIO Channel pipeline, the `configureRedisPipeline`\nmethod is called, e.g.:\n\n```swift\nimport NIORedis\n\nbootstrap.channelInitializer { channel in\n    channel.pipeline\n        .configureRedisPipeline()\n        .then { ... }\n}\n```\n\n\n## Status\n\nThe\n[protocol implementation](Sources/NIORedis/)\nis considered complete. There are a few open ends\nin the `telnet` variant, yet the regular binary protocol is considered done.\n\n\n### Who\n\nBrought to you by\n[ZeeZide](http://zeezide.de).\nWe like\n[feedback](https://twitter.com/ar_institute),\nGitHub stars,\ncool [contract work](http://zeezide.com/en/services/services.html),\npresumably any form of praise you can think of.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftnioextras%2Fswift-nio-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswiftnioextras%2Fswift-nio-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftnioextras%2Fswift-nio-redis/lists"}