How to use the @node-ts/bus-core.BUS_SYMBOLS.Transport function in @node-ts/bus-core

To help you get started, we’ve selected a few @node-ts/bus-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-ts / bus / packages / bus-sqs / src / bus-sqs-module.ts View on Github external
super (async (bind, _, __, rebind) => {
      bind(BUS_SQS_INTERNAL_SYMBOLS.SqsTransport)
        .to(SqsTransport)
        .inSingletonScope()
      bindLogger(bind, SqsTransport)

      rebind>(BUS_SYMBOLS.Transport)
        .toDynamicValue(c => c.container.get(BUS_SQS_INTERNAL_SYMBOLS.SqsTransport))

      bind(BUS_SQS_INTERNAL_SYMBOLS.Sqs)
        .toConstantValue(new SQS())

      bind(BUS_SQS_INTERNAL_SYMBOLS.Sns)
        .toConstantValue(new SNS())

    })
  }
github node-ts / bus / packages / bus-rabbitmq / src / rabbitmq-transport.integration.ts View on Github external
beforeAll(async () => {
    container = new TestContainer()
    container.bind(BUS_RABBITMQ_SYMBOLS.TransportConfiguration).toConstantValue(configuration)
    bus = container.get(BUS_SYMBOLS.Bus)
    sut = container.get(BUS_SYMBOLS.Transport)

    bootstrap = container.get(BUS_SYMBOLS.ApplicationBootstrap)
    bootstrap.registerHandler(TestCommandHandler)

    const connectionFactory = container.get<() => Promise>(BUS_RABBITMQ_INTERNAL_SYMBOLS.AmqpFactory)
    connection = await connectionFactory()
    channel = await connection.createChannel()

    await bootstrap.initialize(container)
  })
github node-ts / bus / packages / bus-sqs / src / sqs-transport.integration.ts View on Github external
beforeAll(async () => {
    container = new TestContainer()
    container.bind(BUS_SQS_SYMBOLS.SqsConfiguration).toConstantValue(sqsConfiguration)
    sut = container.get(BUS_SYMBOLS.Transport)
    sqs = container.get(BUS_SQS_INTERNAL_SYMBOLS.Sqs)
    sns = container.get(BUS_SQS_INTERNAL_SYMBOLS.Sns)
    bus = container.get(BUS_SYMBOLS.Bus)
    bootstrap = container.get(BUS_SYMBOLS.ApplicationBootstrap)

    handleChecker = Mock.ofType()
    container.bind(HANDLE_CHECKER).toConstantValue(handleChecker.object)

    bootstrap.registerHandler(TestCommandHandler)
  })
github node-ts / bus / packages / bus-rabbitmq / src / bus-rabbitmq-module.ts View on Github external
super (async (bind, _, __, rebind) => {
      bind(BUS_RABBITMQ_INTERNAL_SYMBOLS.RabbitMqTransport)
        .to(RabbitMqTransport)
        .inSingletonScope()
      bindLogger(bind, RabbitMqTransport)

      rebind>(BUS_SYMBOLS.Transport)
        .to(RabbitMqTransport)
        .inSingletonScope()

      bind(BUS_RABBITMQ_INTERNAL_SYMBOLS.AmqpFactory)
        .toFactory(c => async () => {
          const configuration = c.container
            .get(BUS_RABBITMQ_SYMBOLS.TransportConfiguration)
          return connect(configuration.connectionString)
        })

    })
  }