Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove event aggregator #852

Open
wants to merge 1 commit into
base: feature/TAO-10203-advanced-search
Choose a base branch
from

Conversation

siwane
Copy link
Contributor

@siwane siwane commented Oct 20, 2020

This PR aims to delete eventAggregator.

After investigation, this service aggregate events and iterate on it to emit them. It also defer emission that is a breaking change, especially for core_kernel_classes_Resource

Copy link
Contributor

@bartlomiejmarszal bartlomiejmarszal left a comment

Choose a reason for hiding this comment

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

LGTM

$eventAggregator = $this->getServiceManager()->get(EventAggregator::SERVICE_ID);
$eventAggregator->put($this->getUri(), new ResourceUpdated($this));
$eventManager = $this->getServiceManager()->get(EventManager::SERVICE_ID);
$eventManager->trigger(new ResourceUpdated($this));
Copy link
Contributor

Choose a reason for hiding this comment

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

Now it executes the event, before It seems it just aggregated by URI, so when one URI is used, all the events are triggered. Will we have same behavior now? Why did we change it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have changed it because it is deferring event and we do not know what it will imply, it is a breaking changes

Copy link
Contributor

Choose a reason for hiding this comment

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

After @andreluizmachado answer would we keep the removal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would say yes, he confirms that this service tries to improve the taskqueue mechanism and avoid multiple calls based on events.
This workaround is good but the problem stay the same. I can close it, but number of triggered events will not changed (only the emition)
And, as discussed with @andreluizmachado , this fix is changing behavior of eventManager for the whole platform and can create side effect. Need to be confirmed by regression tests

Copy link
Contributor

@boajer boajer left a comment

Choose a reason for hiding this comment

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

  • New code is covered by tests (if applicable)
  • Tests are running successfully (old and new ones) on my local machine (if applicable)
  • New code is respecting code style rules
  • New code is respecting best practices
  • New code is not subject to concurrency issues (if applicable)
  • Feature is working correctly on my local machine (if applicable)
  • Acceptance criteria are respected
  • Pull request title and description are meaningful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants