@autofleet/rabbit 3.3.22-connection-test-beta → 3.4.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nvmrc +1 -1
- package/dist/index.d.ts +29 -0
- package/dist/index.js +459 -94
- package/dist/lib/celery.d.ts +9 -0
- package/dist/lib/celery.js +54 -0
- package/dist/lib/types.d.ts +1 -0
- package/package.json +6 -3
- package/src/index.ts +542 -107
- package/src/lib/celery.ts +89 -0
- package/src/lib/types.ts +2 -0
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
v22.9.0
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { AmqpConnectionManager, ChannelWrapper, CreateChannelOpts } from 'amqp-c
|
|
|
4
4
|
import { ConfirmChannel, ConsumeMessage, Options, Replies } from 'amqplib';
|
|
5
5
|
import { RedisConfig } from './lib/redis';
|
|
6
6
|
import { CallbackFunction, ConsumeMessageOrNull, ConsumeOptions, CustomMessageHeaders, QueuesCache, RedisLockType, ExchangesCache, QueueSetupPromisesDictionary, AssertExchangePromisesDictionary } from './lib/types';
|
|
7
|
+
import { TaskData } from './lib/celery';
|
|
7
8
|
export interface IAfRabbitMq {
|
|
8
9
|
ack: any;
|
|
9
10
|
nack: any;
|
|
@@ -73,7 +74,22 @@ declare class RabbitMq implements IAfRabbitMq {
|
|
|
73
74
|
/** Array of consumers tags used for canceling consumption */
|
|
74
75
|
consumersTags: Array<[ConfirmChannel, string]>;
|
|
75
76
|
private consumers;
|
|
77
|
+
private doesVHostExist;
|
|
78
|
+
private vhost;
|
|
79
|
+
oldChannel: ChannelWrapper | null;
|
|
80
|
+
oldPublishChannelSetupPromise: Promise<ChannelWrapper> | null;
|
|
81
|
+
oldBlockReconnect: boolean | null | undefined;
|
|
82
|
+
oldConnection: AmqpConnectionManager | null | undefined;
|
|
83
|
+
oldEm: EventEmitter;
|
|
84
|
+
oldCreatingConnection: boolean;
|
|
85
|
+
oldExchanges: ExchangesCache;
|
|
86
|
+
oldQueues: QueuesCache;
|
|
87
|
+
oldQueueSetupPromises: QueueSetupPromisesDictionary;
|
|
88
|
+
oldAssertExchangePromises: AssertExchangePromisesDictionary;
|
|
89
|
+
oldConsumersTags: Array<[ConfirmChannel, string]>;
|
|
90
|
+
private oldConsumers;
|
|
76
91
|
constructor(options?: AfRabbitOptions, redisConfig?: RedisConfig);
|
|
92
|
+
private assertVHost;
|
|
77
93
|
private shouldConsumeMessageByTimestamp;
|
|
78
94
|
ack: (channel: ConfirmChannel, msg: ConsumeMessageOrNull, shouldUpdateRedisTimestamp?: boolean, releaseLock?: null) => (userMsg: ConsumeMessage) => Promise<any>;
|
|
79
95
|
nack: (channel: ConfirmChannel, queue: string, options: any, deadQueueOptions: Options.AssertQueue, msg: ConsumeMessageOrNull, releaseLock: any) => (userMsg: ConsumeMessageOrNull, { skipRetry, }?: NackOptions) => Promise<any>;
|
|
@@ -89,13 +105,26 @@ declare class RabbitMq implements IAfRabbitMq {
|
|
|
89
105
|
assertQueue(queueName: string, options?: Options.AssertQueue): Promise<any>;
|
|
90
106
|
private saveConsumer;
|
|
91
107
|
consume(queue: string, callback: CallbackFunction, options?: ConsumeOptions): Promise<any>;
|
|
108
|
+
consumeNew(queue: string, callback: CallbackFunction, options?: ConsumeOptions): Promise<any>;
|
|
109
|
+
consumeOld(queue: string, callback: CallbackFunction, options?: ConsumeOptions): Promise<any>;
|
|
92
110
|
private lockRedisIfNeeded;
|
|
93
111
|
private unlockRedisIfNeeded;
|
|
94
112
|
private consumeFromRabbit;
|
|
95
113
|
consumeFromExchange(queue: string, exchange: string, callback: CallbackFunction, options?: ConsumeOptions): Promise<any>;
|
|
96
114
|
publish(exchange: string, content: any, customHeaders?: any): Promise<boolean>;
|
|
97
115
|
sendToQueue(queue: string, content: any, options?: any, customHeaders?: any): Promise<boolean | undefined>;
|
|
116
|
+
sendToCeleryQueue(data: TaskData, taskName: string, queueName: string): Promise<boolean | undefined>;
|
|
98
117
|
isConnected(): Promise<boolean>;
|
|
99
118
|
gracefulShutdown(signal: string): Promise<void>;
|
|
119
|
+
private consumeFromRabbitOld;
|
|
120
|
+
getNewChannelOld({ name, onClose, options }?: newChannelOpts): Promise<ChannelWrapper>;
|
|
121
|
+
getConnectionOld(): Promise<AmqpConnectionManager>;
|
|
122
|
+
private saveConsumerOld;
|
|
123
|
+
assertQueueOld(queueName: string, options?: Options.AssertQueue): Promise<any>;
|
|
124
|
+
setupQueueOld(queueName: string, options?: Options.AssertQueue): Promise<Replies.AssertQueue>;
|
|
125
|
+
assertChannelOld({ force }?: assertChannelOpts): Promise<ChannelWrapper>;
|
|
126
|
+
private deleteQueueOld;
|
|
127
|
+
assertExchangeOld(exchangeName: string, options?: any): Promise<any>;
|
|
100
128
|
}
|
|
101
129
|
export default RabbitMq;
|
|
130
|
+
export { sendCeleryTaskViaHttp, } from './lib/celery';
|