push method

  1. @override
Future<String> push(
  1. String queue,
  2. String payload
)
override

Push a job to the queue

Implementation

@override
Future<String> push(String queue, String payload) async {
  final job = Job(
    id: DateTime.now().millisecondsSinceEpoch.toString(),
    queue: queue,
    payload: payload,
    createdAt: DateTime.now(),
  );

  _queues.putIfAbsent(queue, () => []).add(job);
  return job.id;
}