Download the PHP package 3slab/vdm-library-flysystem-transport-bundle without Composer
On this page you can find all versions of the php package 3slab/vdm-library-flysystem-transport-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 3slab/vdm-library-flysystem-transport-bundle
More information about 3slab/vdm-library-flysystem-transport-bundle
Files in 3slab/vdm-library-flysystem-transport-bundle
Package vdm-library-flysystem-transport-bundle
Short Description Vdm Flysystem Transport
License proprietary
Informations about the package vdm-library-flysystem-transport-bundle
VdmLibraryFlysystemTransportBundle
This symfony messenger extension provides a transport to pull data from flysystem compatible source.
Note : it uses flysystem 2.x
Installation
Configuration reference
Configuration | Description |
---|---|
dsn | the name of the flysystem service you want to collect from prefixed by vdm+flysystem:// |
retry_strategy.max_retries | needs to be 0 because flysystem transport does not support this feature |
options.flysystem_executor | set the id (in the container of services) of a custom flysystem executor to use instead of the DefaultFlysystemExecutor |
Flysystem Executor
Flysystem executor allows you to customize the behavior of the flysystem transport per transport definition inside your messenger.yaml
file.
Some example use cases are that you may want to list content recursively or not. Or you want to delete processed files from source on ack
.
If you don't set a custom flysystem_executor
option when declaring the transport, the default DefaultFlysystemExecutor is used
which makes a shallow list of all files in the flysystem storage and download each file one by one before yielding the file metadata to the transport handler in a
FlysystemMessage instance.
You can override this behavior in your project by providing a class that extends
Vdm\Bundle\LibraryFlysystemTransportBundle\Executor\AbstractFlysystemExecutor
or
Vdm\Bundle\LibraryFlysystemTransportBundle\Executor\DefaultFlysystemExecutor
if you just want to tweak default behavior.
The next example is based on the default executor but perform a deep list in the storage instead of the default shallow one.
There are 2 important things your custom executor needs to do :
yield
a new envelope- Add a
StopAfterHandleStamp
stamp to the yielded envelope if you want to stop after handling the last message (if not, the messenger worker may loop over and will execute it once again without stopping). This is done automatically by thegetEnvelope
method with its param$isLast
.
Note : thanks to the yield system, you can implement a loop in your execute function and return items once at a time
Note : you can keep state in your custom executor
Then references this custom executor in your transport definition in your project messenger.yaml
:
All versions of vdm-library-flysystem-transport-bundle with dependencies
3slab/vdm-library-bundle Version ^3.0
league/flysystem-bundle Version ^2.0
league/flysystem-sftp Version ^2.0