-
Notifications
You must be signed in to change notification settings - Fork 64
/
exchange.ts
28 lines (25 loc) · 841 Bytes
/
exchange.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
* Copyright (c)
* Weyoss <weyoss@protonmail.com>
* https://github.com/weyoss
*
* This source code is licensed under the MIT license found in the LICENSE file
* in the root directory of this source tree.
*/
import { IQueueParams } from '../queue';
import { ICallback } from 'redis-smq-common';
import { EExchangeType } from './common';
export interface IExchangeSerialized<
BindingParams,
ExchangeType extends EExchangeType,
> {
readonly type: ExchangeType;
readonly bindingParams: BindingParams;
readonly exchangeTag: string;
}
export interface IExchange<BindingParams, ExchangeType extends EExchangeType>
extends IExchangeSerialized<BindingParams, ExchangeType> {
toJSON(): IExchangeSerialized<BindingParams, ExchangeType>;
getQueues(cb: ICallback<IQueueParams[]>): void;
getBindingParams(): BindingParams;
}