@relaybus/rabbitmq 0.3.0 → 0.3.1

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/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter } from 'node:events';
2
- import { NonRetryableError, RelayBusError, EventHeaders, EventEnvelope, RetryPolicyOptions, Duration, RelayBusLogger, Transport, TransportMessageHandler, TransportSubscriptionHooks, CloseOptions } from '@relaybus/core';
3
- import { JsonEnvelopeMapping } from '@relaybus/core/internal';
2
+ import { NonRetryableError, RelayBusError, EventHeaders, EventEnvelope, RetryPolicyOptions, Duration, RelayBusLogger, CloseOptions } from '@relaybus/core';
3
+ import { JsonEnvelopeMapping, SubscribingTransport, TransportSubscription } from '@relaybus/core/internal';
4
4
  export { fromHeader, fromPayloadField } from '@relaybus/core/internal';
5
5
 
6
6
  /**
@@ -458,7 +458,7 @@ interface ConnectOptions {
458
458
  * consumer. Events published meanwhile are rejected, and therefore retried by
459
459
  * the outbox, rather than buffered in memory.
460
460
  */
461
- declare class RabbitMqTransport implements Transport {
461
+ declare class RabbitMqTransport extends SubscribingTransport {
462
462
  #private;
463
463
  readonly name: string;
464
464
  readonly system = "rabbitmq";
@@ -492,7 +492,7 @@ declare class RabbitMqTransport implements Transport {
492
492
  * to `onMessage`. Call it once per transport; give each subscription its own
493
493
  * transport instance, with its own `name` and `consumerGroup`.
494
494
  */
495
- subscribe(destinations: readonly string[], onMessage: TransportMessageHandler, hooks?: TransportSubscriptionHooks): Promise<void>;
495
+ protected openSubscription({ destinations, onMessage, hooks, }: TransportSubscription): Promise<void>;
496
496
  /**
497
497
  * Stops consuming, waits up to `shutdownTimeout` for running handlers
498
498
  * (messages still being retried go back to the queue), then closes the
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter } from 'node:events';
2
- import { NonRetryableError, RelayBusError, EventHeaders, EventEnvelope, RetryPolicyOptions, Duration, RelayBusLogger, Transport, TransportMessageHandler, TransportSubscriptionHooks, CloseOptions } from '@relaybus/core';
3
- import { JsonEnvelopeMapping } from '@relaybus/core/internal';
2
+ import { NonRetryableError, RelayBusError, EventHeaders, EventEnvelope, RetryPolicyOptions, Duration, RelayBusLogger, CloseOptions } from '@relaybus/core';
3
+ import { JsonEnvelopeMapping, SubscribingTransport, TransportSubscription } from '@relaybus/core/internal';
4
4
  export { fromHeader, fromPayloadField } from '@relaybus/core/internal';
5
5
 
6
6
  /**
@@ -458,7 +458,7 @@ interface ConnectOptions {
458
458
  * consumer. Events published meanwhile are rejected, and therefore retried by
459
459
  * the outbox, rather than buffered in memory.
460
460
  */
461
- declare class RabbitMqTransport implements Transport {
461
+ declare class RabbitMqTransport extends SubscribingTransport {
462
462
  #private;
463
463
  readonly name: string;
464
464
  readonly system = "rabbitmq";
@@ -492,7 +492,7 @@ declare class RabbitMqTransport implements Transport {
492
492
  * to `onMessage`. Call it once per transport; give each subscription its own
493
493
  * transport instance, with its own `name` and `consumerGroup`.
494
494
  */
495
- subscribe(destinations: readonly string[], onMessage: TransportMessageHandler, hooks?: TransportSubscriptionHooks): Promise<void>;
495
+ protected openSubscription({ destinations, onMessage, hooks, }: TransportSubscription): Promise<void>;
496
496
  /**
497
497
  * Stops consuming, waits up to `shutdownTimeout` for running handlers
498
498
  * (messages still being retried go back to the queue), then closes the