utopia_queue 0.3.1 copy "utopia_queue: ^0.3.1" to clipboard
utopia_queue: ^0.3.1 copied to clipboard

Light and easy to use queue library for Dart server projects

example/utopia_queue_example.dart

import 'dart:io';

import 'package:utopia_queue/utopia_queue.dart';

void main(List<String> arguments) async {
  final connection = await ConnectionRedis.init('localhost', 6379);
  final Server server = Server(connection, queue: 'myqueue');

  server.setResource('res1', () {
    return 'hello res 1';
  });

  server
      .job()
      .inject('message')
      .inject('res1')
      .action((Message message, String res1) {
    print('res1: $res1');
    sleep(Duration(seconds: 2));
    print(message.toMap());
  });
  server.start(threads: 3);
}
1
likes
150
pub points
0%
popularity

Publisher

verified publisherappwriters.dev

Light and easy to use queue library for Dart server projects

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

redis, utopia_di, uuid

More

Packages that depend on utopia_queue