A model factory library for creating expressive, auto-completable, on-demand dev/test fixtures with Symfony and Doctrine.
Assertions and helpers for testing your symfony/messenger queues.
Schedule Cron jobs (commands/callbacks/bash scripts) within your Symfony application.
Alternative, opinionated helpers for testing emails sent with symfony/mailer.
Alternative, opinionated helper for testing Symfony console commands.
Interesting! Proposition 1 or 2 seems like the best method as 3 would always cache which might not be desired?
For live components, on initial render, the cache would be used but then on-interaction, we'd ignore the cache?
make StoredMessage abstract
add failure support
add helper methods to StoredMessage
One thing I think is missing: making the output available if there's an exception. Consider a system that tracks messages and emails an admin on failure. I can attest that this is valuable information.
What about wrapping the caught exception in a new RunCommandMessageException
that contains the output?
changelog: update [skip ci]
upgrade to 6.3
add scheduler
add schedule
I don't believe this bundle will support symfony/scheduler
messages out of the box. This is because the SendMessageToTransportsEvent
isn't fired when dispatching scheduled messages.
I think what we'd need to do to support is:
WorkerMessageReceivedEvent
: if scheduled message:StoredMessage
with $dispatchedAt === $receivedAt
MonitorIdStamp
hereWorkerMessageHandledEvent
: update as normalWith symfony/scheduler
, we could auto-add schedule
and schedule:<name>
tags to these messages.
Laravel Horizon has the concept of tags. I think this could be pretty trivial to add to this bundle via a Stamp and perhaps an attribute:
// as an explicit stamp when dispatching
$bus->dispatch(new RenderVideo($video), [
new TagStamp('render', 'video:'.$video->getId()),
]);
// as an attribute on the message
#[MessageTag('render')]
class RenderVideo
{}
The tags could be saved as a json column in the db for lookup/monitoring.
bump min dragonmantank/cron-expression version to 3.1
fix psalm error
There's likely other methods I can use to achieve this same system with symfony/scheduler so I'm not dead set on this being added.
I've played a little with this. I could have my own custom logic to generate an identifier for a RecurringMessage
and I can infer the scheduler name from RecievedStamp::$transport
(schedule_default
or schedule_foo
).
But I think I'd need the RecurringMessage
added to the ScheduledStamp
or the Trigger object as a bare minimum in order to connect runs with a specific RecurringMessage
.
Basically, I think we need more context added to the ScheduledStamp
but it's not possible with the way it's currently coded.
[Scheduler] add "hashed" cron expression support
bot: fix cs [skip ci]
@ndench, can you confirm this fixes your issue in #443 and I'll tag a bugfix.
fixes #443
/cc @ndench