How to use the resolve-query.constants.modelTypes function in resolve-query

To help you get started, we’ve selected a few resolve-query 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 reimagined / resolve / packages / core / resolve-runtime / src / cloud_entry.js View on Github external
eventDescriptor
              )
            })
            .catch(error => {
              resolveLog(
                'warn',
                'Lambda can not publish event into MQTT',
                eventDescriptor,
                error
              )
            })
        )
      }

      const executors = resolve.executeQuery.getExecutors(
        queryConstants.modelTypes.readModel
      )

      for (const executor of executors) {
        applicationPromises.push(executor.updateByEvents(events))
      }

      await Promise.all(applicationPromises)
      executorResult = true
    }
  } finally {
    await disposeResolve(resolve)
    resolveLog('debug', 'Lambda handler has disposed resolve instance')
  }

  if (executorResult == null) {
    throw new Error(`Lambda cannot be invoked with event: ${lambdaEvent}`)
github reimagined / resolve / packages / core / resolve-runtime / src / local_entry.js View on Github external
const initEventLoop = async resolve => {
  const executors = resolve.executeQuery.getExecutors(
    queryConstants.modelTypes.readModel
  )

  const unsubscribe = await resolve.eventStore.loadEvents(
    { skipStorage: true },
    async event => {
      resolve.pubsubManager.dispatch({
        topicName: event.type,
        topicId: event.aggregateId,
        event
      })

      const applicationPromises = []
      for (const executor of executors) {
        applicationPromises.push(executor.updateByEvents([event]))
      }

resolve-query

Provides an interface used to create and querry read models and view models in a reSolve application.

MIT
Latest version published 4 years ago

Package Health Score

48 / 100
Full package analysis