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
1. Added RetryPolicyInterceptor for Queue component
Added Spiral\Queue\Interceptor\Consume\RetryPolicyInterceptor to enable automatic job retries with a configurable retry policy. To use it, need to add the Spiral\Queue\Attribute\RetryPolicy attribute to the job class:
The exception must implement the two methods isRetryable and getRetryPolicy. These methods can override the retry behavior and cancel the re-queue- or change the retry policy.
If a RetryException is thrown while a job runs, the job will be re-queued according to the retry policy.
2. Added the ability to configure serializer and job type for Queue component via attributes
Added ability to configure serializer and job type using attributes.
use App\Domain\User\Entity\User;
use Spiral\Queue\Attribute\Serializer;
use Spiral\Queue\Attribute\JobHandler as Handler;
use Spiral\Queue\JobHandler;
#[Handler('ping')]
#[Serializer('marshaller-json')]
final class Ping extends JobHandler
{
public function invoke(User $payload): void
{
// ...
}
}
4. Added the ability to register additional translation directories
Now you can register additional directories with translation files for the Translator component. This can be useful when developing additional packages for the Spiral Framework, where the package may provide translation files (for example, validators). Translation files in an application can override translations from additional directories.
A directory with translations can be registered via the Spiral\Bootloader\I18nBootloader bootloader or translator.php configuration file.
5. Added the ability to store snapshots using Storage component
Have you ever faced challenges in storing your app's exception snapshots when working with stateless applications? We've got some good news. With our latest update, we've made it super easy for you.
By integrating with the spiral/storage component, we're giving your stateless apps the power to save exception snapshots straight into S3.
Why is this awesome for you?
Simplified Storage: No more juggling with complex storage solutions. Save snapshots directly to S3 with ease.
Tailored for Stateless Apps: Designed specifically for stateless applications, making your deployments smoother and hassle-free.
Reliability: With S3's proven track record, know your snapshots are stored safely and can be accessed whenever you need.
How to use:
Switch to the new bootloader: Swap out Spiral\Bootloader\SnapshotsBootloader with Spiral\Bootloader\StorageSnapshotsBootloader.
Set up your bucket for snapshot storage and specify the desired bucket using the SNAPSHOTS_BUCKET environment variable.
Modify app/src/Application/Bootloader/ExceptionHandlerBootloader.php to replace the exception reporter Spiral\Exceptions\Reporter\FileReporter with Spiral\Exceptions\Reporter\StorageReporter in the boot method (an example for a default installation of spiral/app).
6. Introduced new prototype:list console command for listing prototype dependencies
The prototype:list command is a super cool addition to our Spiral Framework. It helps developers by providing an easy way to list all the classes registered in the Spiral\Prototype\PrototypeRegistry. These registered classes are essential for project prototyping.
How to Use It
Using the command is simple. Just run the following line in your terminal:
php app.php prototype:list
Once you do that, you'll get a neat table that displays all the registered prototypes, including their names and target classes. This makes it incredibly easy to see what's available for your project prototyping needs.
This new feature enhances developer productivity and ensures that we're making the most of the Spiral Framework's capabilities. It provides clarity on available prototypes, which can be crucial when building and extending our projects.
Note
You might notice that we've also renamed the old prototype:list command to prototype:usage to better align with its purpose.
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
-
Improvements
1. Added
RetryPolicyInterceptor
for Queue componentAdded
Spiral\Queue\Interceptor\Consume\RetryPolicyInterceptor
to enable automatic job retries with a configurable retry policy. To use it, need to add theSpiral\Queue\Attribute\RetryPolicy
attribute to the job class:Create an exception that implements interface
Spiral\Queue\Exception\RetryableExceptionInterface
:The exception must implement the two methods isRetryable and getRetryPolicy. These methods can override the retry behavior and cancel the re-queue- or change the retry policy.
If a
RetryException
is thrown while a job runs, the job will be re-queued according to the retry policy.Pull request: #980 by @msmakouz
2. Added the ability to configure serializer and job type for Queue component via attributes
Added ability to configure serializer and job type using attributes.
Pull request: #990 by @msmakouz
3. Added the ability to configure the Monolog messages format
Now you can configure the Monolog messages format via environment variable
MONOLOG_FORMAT
.Pull request: #994 by @msmakouz
4. Added the ability to register additional translation directories
Now you can register additional directories with translation files for the Translator component. This can be useful when developing additional packages for the Spiral Framework, where the package may provide translation files (for example, validators). Translation files in an application can override translations from additional directories.
A directory with translations can be registered via the
Spiral\Bootloader\I18nBootloader
bootloader ortranslator.php
configuration file.Via I18nBootloader bootloader
Via configuration file
Pull request: #996 by @msmakouz
5. Added the ability to store snapshots using
Storage
componentHave you ever faced challenges in storing your app's exception snapshots when working with stateless applications? We've got some good news. With our latest update, we've made it super easy for you.
By integrating with the
spiral/storage
component, we're giving your stateless apps the power to save exception snapshots straight into S3.Why is this awesome for you?
How to use:
Spiral\Bootloader\SnapshotsBootloader
withSpiral\Bootloader\StorageSnapshotsBootloader
.SNAPSHOTS_BUCKET
environment variable.app/src/Application/Bootloader/ExceptionHandlerBootloader.php
to replace the exception reporterSpiral\Exceptions\Reporter\FileReporter
withSpiral\Exceptions\Reporter\StorageReporter
in theboot
method (an example for a default installation of spiral/app).Pull request: #986 by @msmakouz
6. Introduced new
prototype:list
console command for listing prototype dependenciesThe
prototype:list
command is a super cool addition to our Spiral Framework. It helps developers by providing an easy way to list all the classes registered in theSpiral\Prototype\PrototypeRegistry
. These registered classes are essential for project prototyping.How to Use It
Using the command is simple. Just run the following line in your terminal:
Once you do that, you'll get a neat table that displays all the registered prototypes, including their names and target classes. This makes it incredibly easy to see what's available for your project prototyping needs.
Why It Matters
This new feature enhances developer productivity and ensures that we're making the most of the Spiral Framework's capabilities. It provides clarity on available prototypes, which can be crucial when building and extending our projects.
Pull request: #1003 by @msmakouz
Other changes
array
tomixed
by @msmakouz in [spiral/scaffolder] Changing job payload type fromarray
tomixed
#992bubble
astrue
by default in logRotate method by @msmakouz in [spiral/monolog-bridge] Setbubble
astrue
by default in logRotate method #997Bug fixes
Full Changelog: 3.8.4...3.9.0
This discussion was created from the release v3.9.0.
Beta Was this translation helpful? Give feedback.
All reactions