Lisk-sdk: Use channel instead of event emitter

Created on 17 Jun 2019  路  4Comments  路  Source: LiskHQ/lisk-sdk

Expected behavior

Within module, it should consistently use channel instead of event emitter.
Event emitter can handle internal events within modules too.

Actual behavior

Event emitter was used when removing bus

Which version(s) does this affect? (Environment, OS, etc...)

2.2-

wontfix

Most helpful comment

@shuse2, regarding the ongoing BFT implementation, the way events are currently emitted is not consistent, for example EVENT_NEW_BLOCK is not emitted when receiving a block from the network passively and applying it.

I have an idea in mind to unify this behavior for example by emitting this in processBlock or similar, but using channels.

This is what it currently looks like on 2.0:

image

We also have to take into account EVENT_NEW_BROADHASH in the new BFT impl.

All 4 comments

This issue need to consider future impact on the modules which will be in the elements

@shuse2, regarding the ongoing BFT implementation, the way events are currently emitted is not consistent, for example EVENT_NEW_BLOCK is not emitted when receiving a block from the network passively and applying it.

I have an idea in mind to unify this behavior for example by emitting this in processBlock or similar, but using channels.

This is what it currently looks like on 2.0:

image

We also have to take into account EVENT_NEW_BROADHASH in the new BFT impl.

Let's remember to have into account potential cases described in https://github.com/LiskHQ/lisk-sdk/issues/3539

Closing because channel is now consistently use for external communication from the framework, and internally eventEmitter is used.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ScrewchMcMuffin picture ScrewchMcMuffin  路  3Comments

willclarktech picture willclarktech  路  4Comments

ManuGowda picture ManuGowda  路  3Comments

ManuGowda picture ManuGowda  路  3Comments

Tschakki picture Tschakki  路  4Comments