You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently jobs handle method allows DI. It allows to easily test handle method in unit tests, by providing mocked services.
But when job fails, the failed method is called, that has only param for exception. If you need some dependencies, inside failed you need to use Facades or Helper functions, for example app(Some::class) to get dependency. You cannot test such things in unit tests, and need to create feature tests, which will bring entire framework, and are more slow, than unit tests.
It would be great, if failed can have more params, and all params except first are resolved via container. This is backward compatible improvement.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Currently jobs handle method allows DI. It allows to easily test handle method in unit tests, by providing mocked services.
But when job fails, the failed method is called, that has only param for exception. If you need some dependencies, inside failed you need to use Facades or Helper functions, for example app(Some::class) to get dependency. You cannot test such things in unit tests, and need to create feature tests, which will bring entire framework, and are more slow, than unit tests.
It would be great, if failed can have more params, and all params except first are resolved via container. This is backward compatible improvement.
Beta Was this translation helpful? Give feedback.
All reactions