Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@intech
Copy link
Member

@intech intech commented Jun 5, 2022

🎯 Relevant issues

issue#1065

πŸ’Ž Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

🏁 Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have commented my code, particularly in hard-to-understand areas


await Promise.delay(500);
// event loop lag <10ms
await Promise.delay(510);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this issue is the next tick in node v10, and the test fails. The timeout should be 510ms (although it works with 501ms) because the action already has a 500ms timeout.
It is likely that after v10, optimization was carried out for placing events in a queue, and on later versions, the test passed successfully with the same delay of 500 ms.

@intech intech changed the title fix(service-broker): local emit & broadcast handlers changed from async to event-driven fix(event-catalog): local emit & broadcast handlers changed from async to event-driven Jun 6, 2022

this.EndpointFactory = EventEndpoint;

this.on("broker.event", ctx => {
Copy link
Member

@icebob icebob Jun 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we should use an event emitter to call a non-await-ed method? I feel it's too expensive. Not enough just skip the await in the callEventHandler

@icebob icebob added this to the 0.15 milestone Dec 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants