Skip to content

Conversation

@wachterjohannes
Copy link
Member

</service>
<service id="task.storage.task_execution" alias="task.repository.task_execution"/>

<service id="task.event_listener.execution" class="Task\TaskBundle\EventListener\TaskExecutionListener">
Copy link

Choose a reason for hiding this comment

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

If this service is loaded or not should be configureable. It might be possible that the EntityManager should be cleared although the tasks are stored somewhere else.

}
}

/**
Copy link
Member

Choose a reason for hiding this comment

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

couldnt you use the doctrine internal findOneByUuid function?

Copy link
Member Author

Choose a reason for hiding this comment

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

tbh i dont like this "magic" internal methods.

@wachterjohannes wachterjohannes force-pushed the bugfix/event-after branch 4 times, most recently from 806a917 to 8471371 Compare January 11, 2017 13:47
}
}

/**
Copy link

Choose a reason for hiding this comment

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

Same opinion as @wachterjohannes. This way it will be easier to optimize if there come up performance problem at some time.

/**
* Listens on task-execution events.
*/
class TaskExecutionListener
Copy link

Choose a reason for hiding this comment

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

Shouldn't that be something like DoctrineTaskExecutionListener?

@wachterjohannes
Copy link
Member Author

@danrot fixed

/**
* Listens on task-execution events.
*/
class DoctrineTaskExecutionListener
Copy link

Choose a reason for hiding this comment

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

Sorry to mention that again, but I missed it the last time... Wouldn't it be better to make it a subscriber? Then it could handle all the doctrine specific settings, which might be added later. Otherwise this would have to be renamed to something to include clear.

Copy link
Member Author

Choose a reason for hiding this comment

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

also like this we could handle everything for doctrine - i dont see the difference

Copy link

Choose a reason for hiding this comment

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

Not if you have to do some doctrine specific tasks on different events.

Copy link
Member Author

Choose a reason for hiding this comment

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

thats configuration you can use multiple tags for different events.

Copy link

Choose a reason for hiding this comment

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

Ok, that's true, but I think it is a little bit hidden in the configuration... And since this class is already bound to an event I would also not fear implementing the EventSubscriberInterface... But well, I think that's just personal preference. It's also ok for me this way.

/**
* Listens on task-execution events.
*/
class DoctrineTaskExecutionListener
Copy link

Choose a reason for hiding this comment

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

Ok, that's true, but I think it is a little bit hidden in the configuration... And since this class is already bound to an event I would also not fear implementing the EventSubscriberInterface... But well, I think that's just personal preference. It's also ok for me this way.

composer.json Outdated
"require": {
"php": "~5.5 || ~7.0",
"php-task/php-task": "dev-master",
"php-task/php-task": "dev-bugfix/event-after",
Copy link

Choose a reason for hiding this comment

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

As soon as you've removed this change this can be merged.

@wachterjohannes
Copy link
Member Author

@danrot done

@danrot danrot merged commit 481637c into master Jan 18, 2017
@danrot danrot deleted the bugfix/event-after branch January 18, 2017 08:47
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.

4 participants