mohsenbagheri / kamui
This service helps you to move your data between services
dev-master
2022-02-19 09:53 UTC
Requires
- php: 8.0.*
- laravel/framework: 9.*
- spatie/laravel-signal-aware-command: ^1.2
This package is auto-updated.
Last update: 2025-02-19 16:31:15 UTC
README
About Kamui
This service helps you to communicate between services
Install
composer require spatie/laravel-signal-aware-command
composer require mohsenbagheri/kamui
php artisan vendor:publish
php artisan migrate
Basic usage
routes/Web.php
Route::get('publish', [\App\Http\Controllers\TestController::class, 'publish'])->name('publish');
Route::get('subscribe', [\App\Http\Controllers\TestController::class, 'subscribe'])->name('subscribe');
controller
<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Log;
use Mohsenbagheri\Kamui\Services\Communication\CommunicateRedisService;
class TestController extends Controller
{
public function __construct(private CommunicateRedisService $communicateRedisService)
{
}
public function publish()
{
$this->communicateRedisService->send('test', ['message' => 'hello world!']);
return 'ok';
}
public function subscribe(object $data)
{
Log::info("data", $data);
}
}
command console
php artisan worker:redis test subscribe
or
php artisan worker:rabbitmq test subscribe
#Grpc
Coming soon!