🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

@codefresh-io/eventbus

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codefresh-io/eventbus - npm Package Compare versions

Comparing version

to
0.0.17

@@ -36,12 +36,15 @@ 'use strict';

async quit() {
try {
await Promise.all([this.bus.quit(), this.store.quit()]);
this.emit('quit');
} catch (err) {
throw new CFError({
cause: err,
message: 'Failed during quit execution'
quit() {
return Promise.resolve()
.then(async () => {
try {
await Promise.all([this.bus.quit(), this.store.quit()]);
this.emit('quit');
} catch (err) {
throw new CFError({
cause: err,
message: 'Failed during quit execution'
});
}
});
}
}

@@ -96,11 +99,17 @@

async publish(eventName, msg) {
await this.readyPromise;
await this.store.save(eventName, msg);
await this.bus.publish(eventName, msg);
publish(eventName, msg) {
return Promise.resolve()
.then(async () => {
await this.readyPromise;
await this.store.save(eventName, msg);
await this.bus.publish(eventName, msg);
});
}
async subscribe(eventName, handler, subService) {
await this.readyPromise;
return await this.bus.subscribe(eventName, handler, subService);
subscribe(eventName, handler, subService) {
return Promise.resolve()
.then(async () => {
await this.readyPromise;
return await this.bus.subscribe(eventName, handler, subService);
});
}

@@ -113,5 +122,8 @@

*/
async getAllAggregateEvents(aggregateId, fromIndex) {
await this.readyPromise;
return await this.store.getAllAggregateEvents(aggregateId, fromIndex);
getAllAggregateEvents(aggregateId, fromIndex) {
return Promise.resolve()
.then(async () => {
await this.readyPromise;
return await this.store.getAllAggregateEvents(aggregateId, fromIndex);
});
}

@@ -124,5 +136,8 @@

*/
async getAllEventsByName(name, fromIndex) {
await this.readyPromise;
return await this.store.getAllEventsByName(name, fromIndex);
getAllEventsByName(name, fromIndex) {
return Promise.resolve()
.then(async () => {
await this.readyPromise;
return await this.store.getAllEventsByName(name, fromIndex);
});
}

@@ -129,0 +144,0 @@

{
"name": "@codefresh-io/eventbus",
"version": "0.0.16",
"version": "0.0.17",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",