import Client from "./client"; import { AsyncResult } from "./result"; /** Task executation options * Originally allows these keys: * ['queue', 'routing_key', 'exchange', 'priority', 'expires', * 'serializer', 'delivery_mode', 'compression', 'time_limit', * 'soft_time_limit', 'immediate', 'mandatory'] * but now only part of them are supported. */ export declare type TaskOptions = { exchange?: string; queue?: string; routingKey?: string; }; export default class Task { client: Client; name: string; options?: TaskOptions; /** * Asynchronous Task * @constructor Task * @param {Client} clinet celery client instance * @param {string} name celery task name * @param {Object} [options] * @param {string} [options.queue] queue name * @param {string} [options.routingKey] routing key */ constructor(client: Client, name: string, options?: TaskOptions); /** * @method Task#delay * * @returns {AsyncResult} the result of client.publish * * @example * client.createTask('task.add').delay(1, 2) */ delay(...args: any[]): AsyncResult; applyAsync(args: Array, kwargs?: object, options?: TaskOptions): AsyncResult; }