How to use the @node-ts/bus-core.BusModule 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-starter / src / application-container.ts View on Github external
constructor () {
    super()
    this.load(
      new LoggerModule(),
      new WinstonModule(),
      new BusModule(),
      new BusWorkflowModule(),
      new HandlersModule()
    )
  }
}
github node-ts / bus / packages / bus-workflow / src / workflow / decorators / started.spec.ts View on Github external
beforeAll(async () => {
    container = new Container()
    container.load(new LoggerModule())
    container.load(new BusModule())
    container.load(new BusWorkflowModule())
    container.rebind(LOGGER_SYMBOLS.Logger).toConstantValue(Mock.ofType().object)

    persistence = container.get(BUS_WORKFLOW_SYMBOLS.Persistence)

    const workflowRegistry = container.get(BUS_WORKFLOW_SYMBOLS.WorkflowRegistry)
    await workflowRegistry.registerFunctional(assignmentWorkflow)
    await workflowRegistry.initializeWorkflows()

    bootstrap = container.get(BUS_SYMBOLS.ApplicationBootstrap)
    await bootstrap.initialize(container)

    bus = container.get(BUS_SYMBOLS.Bus)
    await bus.send(event)
    await sleep(CONSUME_TIMEOUT)
  })
github node-ts / bus / packages / bus-workflow / src / workflow / workflow.integration.ts View on Github external
beforeAll(async () => {
    container = new Container()
    container.load(new LoggerModule())
    container.load(new BusModule())
    container.load(new BusWorkflowModule())
    container.rebind(LOGGER_SYMBOLS.Logger).toConstantValue(Mock.ofType().object)

    persistence = container.get(BUS_WORKFLOW_SYMBOLS.Persistence)

    const workflowRegistry = container.get(BUS_WORKFLOW_SYMBOLS.WorkflowRegistry)
    workflowRegistry.register(TestWorkflow, TestWorkflowData)
    workflowRegistry.register(TestWorkflowStartedByCompletes, TestWorkflowStartedByCompletesData)
    workflowRegistry.register(TestWorkflowStartedByDiscard, TestWorkflowStartedByDiscardData)
    await workflowRegistry.initializeWorkflows()

    bootstrap = container.get(BUS_SYMBOLS.ApplicationBootstrap)
    await bootstrap.initialize(container)

    bus = container.get(BUS_SYMBOLS.Bus)
    await bus.send(command)
github node-ts / bus / packages / bus-workflow / src / workflow / workflow-misconfigured.integration.ts View on Github external
beforeAll(async () => {
    container = new Container()
    container.load(new LoggerModule())
    container.load(new BusModule())
    container.load(new BusWorkflowModule())
    logger = Mock.ofType()
    container.rebind(LOGGER_SYMBOLS.Logger).toConstantValue(logger.object)

    persistence = container.get(BUS_WORKFLOW_SYMBOLS.Persistence)

    const workflowRegistry = container.get(BUS_WORKFLOW_SYMBOLS.WorkflowRegistry)
    workflowRegistry.register(TestWorkflowMisconfigured, TestWorkflowMisconfiguredData)
    await workflowRegistry.initializeWorkflows()

    bootstrap = container.get(BUS_SYMBOLS.ApplicationBootstrap)
    await bootstrap.initialize(container)

    bus = container.get(BUS_SYMBOLS.Bus)
    await bus.send(command)
    await sleep(CONSUME_TIMEOUT)