redis

antelopejs/redis

Official
Redis client module with scheduling capabilities

Redis

@antelopejs/redis

npm versionLicenseTypeScript

A Redis client module that implements the Redis and Redis Scheduler interfaces for AntelopeJS.

Installation

ajs project modules add @antelopejs/redis

Interfaces

This module implements two key interfaces:

  • Redis Interface: Promise-based Redis client with key-value operations and pub/sub messaging.
  • Redis Scheduler Interface: Redis-based distributed task scheduler with job queuing and automatic retries.

Both interfaces can be used independently or together depending on your application's needs. The interfaces are installed separately to maintain modularity and minimize dependencies.

NameInstall command
Redisajs module imports add redisDocumentation
Redis Schedulerajs module imports add redis_schedulerDocumentation

Overview

The AntelopeJS Redis module provides functionality for interacting with Redis:

  • Redis client connection management
  • Task scheduling with retry capabilities

Configuration

The Redis module can be configured with standard Redis client options:

{
  "url": "redis://localhost:6379",
  "socket": {
    "reconnectStrategy": true
  }
}

Configuration Details

The module accepts the following configuration properties:

  • All standard Redis client options from the redis package
  • Supports all connection methods including URL string, socket options, etc.

Integration with Other Modules

The Redis module is designed to be used as a dependency for other AntelopeJS modules:

// Example of another module depending on Redis
import { GetClient } from '@ajs/redis/beta';

async function storeValueInRedis(key: string, value: string) {
  const client = await GetClient();
  await client.set(key, value);
}

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.