PHP code example of gplanchat / durable-laravel

1. Go to this page and download the library: Download gplanchat/durable-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gplanchat / durable-laravel example snippets


// config/durable.php
'backend' => 'illuminate',   // or 'temporal', or 'memory'
'connection' => 'durable',   // a connection of its own, see below
'workflows' => [App\Workflows\Onboarding::class],
'activity_handlers' => [App\Activities\OnboardingActivities::class],
'lock' => ['store' => null, 'ttl' => 300, 'wait' => 10],

// config/database.php: the journal on a connection of its own
'connections' => [
    // …the application's…
    'durable' => [
        'driver' => 'pgsql',
        'url' => env('DURABLE_DB_URL'),
    ],
],

$lock = new ResumeLock($cacheStore);          // any store implementing LockProvider
$lock->around($executionId, fn() => $runner->resume($executionId));
bash
php artisan vendor:publish --tag=durable-config