Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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}`)
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]))
}