{"id":15988324,"url":"https://github.com/insertish/redis_kiss","last_synced_at":"2025-11-10T17:31:57.946Z","repository":{"id":110114736,"uuid":"455955821","full_name":"insertish/redis_kiss","owner":"insertish","description":"Stupid library for managing Redis PubSub.","archived":false,"fork":false,"pushed_at":"2023-04-21T18:05:55.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-01T22:41:02.859Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/insertish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2022-02-05T18:45:02.000Z","updated_at":"2022-02-05T18:45:50.000Z","dependencies_parsed_at":"2024-11-08T19:33:10.818Z","dependency_job_id":"38a3f175-023f-4d2d-9e97-06c7044e86a6","html_url":"https://github.com/insertish/redis_kiss","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.1428571428571429,"last_synced_commit":"07df1a43c5000394ed3ae93a4f121dace2dd398a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insertish%2Fredis_kiss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insertish%2Fredis_kiss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insertish%2Fredis_kiss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insertish%2Fredis_kiss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insertish","download_url":"https://codeload.github.com/insertish/redis_kiss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240054485,"owners_count":19740829,"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":[],"created_at":"2024-10-08T04:02:53.771Z","updated_at":"2025-11-10T17:31:57.919Z","avatar_url":"https://github.com/insertish.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redis_kiss\n\nNote: this now also exposes access to the Redis connection pool.\n\nThis is a pretty simple library intended for just consuming and producing messages for Redis PubSub, it does not follow \"good programming practice\" in the slightest but it does work and does simplify the work required.\n\nThe library manages a global pool of Redis connections and creates listener connections on the fly (due to some technical limitations).\n\n## Example\n\nPublish something to Redis:\n\n```rust\n// Handle the Result\u003c_, _\u003e\nredis_kiss::publish(\"channel\", \"data\").await?;\n\n// Log the error instead\nredis_kiss::p(\"channel\", \"data\").await;\n```\n\nSubscribe to Redis (as usual, [see Redis documentation for more info](https://docs.rs/redis/latest/redis/aio/struct.PubSub.html)):\n\n```rust\n// Create a new PubSub connection\nlet mut conn = redis_kiss::open_pubsub_connection().await?;\n\n// Subscribe to something\nconn.subscribe(\"test\").await?;\n\n// Handle incoming messages\nlet mut stream = conn.on_message();\nwhile let Some(item) = stream.next().await {\n    // Use Redis crate API as usual\n    let channel = item.get_channel_name().to_string();\n\n    // Decode the message using previously specified options\n    // into a certain DeserializeOwned data type T, in this case String\n    let payload: String = redis_kiss::decode_payload(\u0026item).await?;\n\n    // You can also choose a specific type on the fly\n    use redis_kiss::PayloadType;\n    let payload: String = redis_kiss::decode_payload(\u0026item, \u0026PayloadType::Msgpack).await?;\n\n    // Do something with channel and payload\n}\n```\n\n## Environment Variables\n\nThe library is provided with options through the environment.\n\n| Name                  | Description                                                                                                  | Default             |\n| --------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------- |\n| `REDIS_URI`           | URI of the Redis server                                                                                      | `redis://localhost` |\n| `REDIS_POOL_MAX_OPEN` | Maximum number of connections in Redis pool (for publishing data)                                            | `1000`              |\n| `REDIS_PAYLOAD_TYPE`  | Data type to use when publishing data to Redis, either `json`, `msgpack` or `bincode`                        | `json`              |\n| `REDIS_KISS_LENIENT`  | Whether to try to automatically decode other payload types if we fail to deserialize it using the chosen one | `1`                 |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsertish%2Fredis_kiss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsertish%2Fredis_kiss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsertish%2Fredis_kiss/lists"}