stem_redis 0.1.0-alpha.3 copy "stem_redis: ^0.1.0-alpha.3" to clipboard
stem_redis: ^0.1.0-alpha.3 copied to clipboard

Redis broker, result backend, and scheduler utilities for Stem.

stem_redis #

pub package Dart License Buy Me A Coffee

Redis Streams broker, result backend, and scheduler utilities for the Stem task runtime.

Install #

dart pub add stem_redis

Add the core runtime if you haven't already:

dart pub add stem

Usage #

import 'package:stem/stem.dart';
import 'package:stem_redis/stem_redis.dart';

Future<void> main() async {
  final registry = SimpleTaskRegistry()
    ..register(FunctionTaskHandler(name: 'demo.hello', handler: print));

  final broker = await RedisStreamsBroker.connect('redis://localhost:6379');
  final backend = await RedisResultBackend.connect('redis://localhost:6379/1');

  final stem = Stem(broker: broker, registry: registry, backend: backend);
  await stem.enqueue('demo.hello', args: {'name': 'Stem'});
}

Tests #

Integration suites require the dockerised Redis/Postgres stack provided by the CLI package:

source ../../stem_cli/_init_test_env
dart test

The redis contract tests will automatically skip if STEM_TEST_REDIS_URL is not set.

0
likes
0
points
38
downloads

Publisher

unverified uploader

Weekly Downloads

Redis broker, result backend, and scheduler utilities for Stem.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

async, collection, redis, stem

More

Packages that depend on stem_redis