Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mumez/redistick
A Redis client for Pharo using Stick auto-reconnection layer
https://github.com/mumez/redistick
gemstone pharo pharo-smalltalk redis-client
Last synced: 4 months ago
JSON representation
A Redis client for Pharo using Stick auto-reconnection layer
- Host: GitHub
- URL: https://github.com/mumez/redistick
- Owner: mumez
- License: mit
- Created: 2020-04-20T08:36:16.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-24T15:08:24.000Z (4 months ago)
- Last Synced: 2024-09-25T21:40:54.482Z (4 months ago)
- Topics: gemstone, pharo, pharo-smalltalk, redis-client
- Language: Smalltalk
- Homepage:
- Size: 391 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RediStick
[![CI](https://github.com/mumez/RediStick/actions/workflows/main.yml/badge.svg)](https://github.com/mumez/RediStick/actions/workflows/main.yml)
A Redis client for Pharo (and GemStone/S) using Stick auto-reconnection layer
Many parts are borrowed from RedisClient.
However RediStick use [Stick](https://github.com/mumez/Stick) for supporting auto reconnection.
## Installation
### Default (Core only)
```smalltalk
Metacello new
baseline: 'RediStick';
repository: 'github://mumez/RediStick/repository';
load.
```### With Connection-Pool package
```smalltalk
Metacello new
baseline: 'RediStick';
repository: 'github://mumez/RediStick/repository';
load: #('Core' 'ConnectionPool').
```### With Pubsub package
```smalltalk
Metacello new
baseline: 'RediStick';
repository: 'github://mumez/RediStick/repository';
load: #('Core' 'Pubsub').
```### With Stream package
```smalltalk
Metacello new
baseline: 'RediStick';
repository: 'github://mumez/RediStick/repository';
load: #('StreamObjects').
```stream low-level API only
```smalltalk
Metacello new
baseline: 'RediStick';
repository: 'github://mumez/RediStick/repository';
load: #('Core' 'Stream').
```### With Search package
```smalltalk
Metacello new
baseline: 'RediStick';
repository: 'github://mumez/RediStick/repository';
load: #('Core' 'Search').
```## Sample Code
### Basic usage
```smalltalk
stick := RsRediStick targetUrl: 'sync://localhost'.
stick connect.stick beSticky. "Auto reconnect when server is not accessible"
stick beSwitchy: 'sync://otherhost'. "Or connect to the secondary server"
stick onError: [ :e | e pass ]. "Or just pass an error (not reconnect) - mainly for debug"stick endpoint info.
stick endpoint get: 'a'.
stick endpoint set: 'a' value: 999.
```### Using a connection pool with a wrapper class
```smalltalk
RsRedisConnectionPool primaryUrl: 'sync://localhost:6379'.
redis := RsRedisProxy of: #client1.
redis at: 'a'.
redis at: 'a' put: 999.
```In this example, the default connection pool is implicitly used through RedisProxy.
### Using Pubsub channel
RediStick provides a channel class for using redis pubsub API very easily.
Please read [Pubsub.md](./doc/Pubsub.md).
### Using Stream
RediStick supports [Redis Streams](https://redis.io/docs/data-types/streams/) - distributed event streaming API.
Please read [Stream.md](./doc/Stream.md).
### Using Search
RediStick supports [RediSearch](https://redis.io/docs/stack/search/) - a full-text search extension for Redis.
Please read [Search.md](./doc/Search.md).