Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ declare(strict_types=1);
namespace App\Task;

use CleverAge\CacheProcessBundle\Task\AbstractCacheTask;
use CleverAge\ProcessBundle\Attribute\AsTask;
use CleverAge\ProcessBundle\Model\ProcessState;

#[AsTask(code: 'app_cache_delete')]
class DeleteTask extends AbstractCacheTask
{
public function execute(ProcessState $state): void
Expand All @@ -77,15 +79,26 @@ class DeleteTask extends AbstractCacheTask
}
```

Its code is given by the `#[AsTask]` attribute (`cleverage/process-bundle` 5.4 or later), prefixed to avoid conflicts
with the codes of the bundles. With autoconfiguration, the task is also non-shared and logs in the
`cleverage_process_task` channel:

```yaml
# config/services.yaml
services:
App\Task\DeleteTask:
public: true
shared: false
autoconfigure: true
arguments: ['@cleverage_cache_process.registry.adapter']
```

```yaml
delete_from_cache:
task: app_cache_delete
options:
adapter: app
key: my_key
```

## Reference

- [Adapter](reference/adapter.md)
Expand Down
Loading