This service helps you to move your data between services

dev-master 2022-02-19 09:53 UTC

This package is auto-updated.

Last update: 2024-04-19 14:54:44 UTC


README

kamui.jpeg

License License License License

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!