TxQueueContainer
usages
// define a component something like this.
@injectable()
export class Q1Component {
@inject(TxTYPES.TxQueuePoint) queuepoint;
constructor() {
}
async init() {
...
}
}
// prepare injector for Q1Component - this done one time.
TxQueueContainer.setDriver(TxConnectorRabbitMQ); // optional, otherwise use default TxConnectorRabbitMQ
TxQueueContainer.addComponent<Q1Component>(Q1Component, 'Q1Component');
// create new 'Q1Component' component under the name 'Q1COMPONENT::QUEUE::CONTAINER'
co = TxQueueContainer.get('Q1Component', 'Q1COMPONENT::QUEUE::CONTAINER');
// send something to queue.
co.queuepoint.queue.next(..);Last updated