Releases: hhxsv5/laravel-s
Releases · hhxsv5/laravel-s
Refactor asynchronous event listen
- Add the enable field to determine whether the socket is enabled or not. It is enabled by default.
- [Incompatible] Define listeners in events, not in the laravels.php configuration file.
use Hhxsv5\LaravelS\Swoole\Task\Event;
class TestEvent extends Event
{
protected $listeners = [
// Listener list
TestListener1::class,
// TestListener2::class,
];
private $data;
public function __construct($data)
{
$this->data = $data;
}
public function getData()
{
return $this->data;
}
}
use Hhxsv5\LaravelS\Swoole\Task\Task;
use Hhxsv5\LaravelS\Swoole\Task\Listener;
class TestListener1 extends Listener
{
/**
* @var TestEvent
*/
protected $event;
public function handle()
{
\Log::info(__CLASS__ . ':handle start', [$this->event->getData()]);
sleep(2);// Simulate the slow codes
// Deliver task in CronJob, but NOT support callback finish() of task.
// Note: Modify task_ipc_mode to 1 or 2 in config/laravels.php, see https://www.swoole.co.uk/docs/modules/swoole-server/configuration
$ret = Task::deliver(new TestTask('task data'));
var_dump($ret);
// throw new \Exception('an exception');// all exceptions will be ignored, then record them into Swoole log, you need to try/catch them
}
}
Optimize laravel-admin cleaner
v3.6.4 optimize laravel-admin cleaner
v3.6.3
Clear cookie for Laravel 6+
v3.6.2 clear cookie for laravel 6+
Add laravel-admin cleaner
- Add laravel-admin cleaner.
- Optimize documents.
Optimize custom process
Support custom process useQueue/pop/push/write/read.
Upgrade Tip: Instead of defining the process name via getName (), use the key name as the process name.
See specific documents.