Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 0 additions & 79 deletions common/oatbox/event/EventAggregator.php

This file was deleted.

32 changes: 0 additions & 32 deletions config/default/eventAggregator.conf.php

This file was deleted.

11 changes: 2 additions & 9 deletions core/kernel/classes/class.Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

use oat\generis\model\OntologyRdf;
use oat\generis\model\OntologyRdfs;
use oat\oatbox\event\EventAggregator;
use oat\oatbox\service\ServiceManager;
use oat\generis\model\OntologyAwareTrait;
use oat\oatbox\event\EventManager;
Expand All @@ -47,11 +46,6 @@ class core_kernel_classes_Resource extends core_kernel_classes_Container
{
use OntologyAwareTrait;

// --- ASSOCIATIONS ---


// --- ATTRIBUTES ---

/**
* long uri as string (including namespace)
* direct access to the uri is deprecated,
Expand Down Expand Up @@ -764,8 +758,7 @@ protected function toResource($value)

private function onUpdate(): void
{
/** @var EventAggregator $eventAggregator */
$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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

}
}
39 changes: 0 additions & 39 deletions migrations/Version202008201138552348_generis.php

This file was deleted.

4 changes: 0 additions & 4 deletions test/OntologyMockTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

namespace oat\generis\test;

use oat\oatbox\event\EventAggregator;
use oat\oatbox\user\UserLanguageServiceInterface;
use oat\oatbox\session\SessionService;
use Prophecy\Argument;
Expand Down Expand Up @@ -74,8 +73,6 @@ protected function getOntologyMock()
*/
private function setupOntology(Ontology $onto)
{
$eventAggregator = new EventAggregator(['numberOfAggregatedEvents'=>10]);

$persistenceManagerWithSqlMock = $this->getPersistenceManagerWithSqlMock('mockSql');
$session = new \common_session_AnonymousSession();
$serviceLocatorMock = $this->getServiceLocatorMock([
Expand All @@ -87,7 +84,6 @@ private function setupOntology(Ontology $onto)
LoggerService::SERVICE_ID => $this->prophesize(LoggerInterface::class)->reveal(),
UriProvider::SERVICE_ID => new Bin2HexUriProvider([Bin2HexUriProvider::OPTION_NAMESPACE => 'http://ontology.mock/bin2hex#']),
SimpleCache::SERVICE_ID => new NoCache(),
EventAggregator::SERVICE_ID => $eventAggregator
]);
$eventAggregator->setServiceLocator($serviceLocatorMock);
$session->setServiceLocator($serviceLocatorMock);
Expand Down
127 changes: 0 additions & 127 deletions test/unit/oatbox/event/EventAggregatorTest.php

This file was deleted.