Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize broadcast connection and queue #296

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 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
4 changes: 3 additions & 1 deletion config/musonza_chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
* Channel: mc-chat-conversation.2,
* Event: Musonza\Chat\Eventing\MessageWasSent
*/
'broadcasts' => false,
'broadcasts' => false,,
'broadcast_connection' => 'sync',
'broadcast_queue' => 'default',

/*
* Specify the fields that you want to return each time for the sender.
Expand Down
4 changes: 4 additions & 0 deletions src/Eventing/MessageWasSent.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ class MessageWasSent extends Event implements ShouldBroadcast
use InteractsWithSockets;
use SerializesModels;
public $message;
public $connection;
public $queue;

public function __construct(Message $message)
{
$this->message = $message;
$this->connection = config('musonza_chat.broadcast_connection', 'sync');
$this->queue = config('musonza_chat.broadcast_queue', 'default');
}

/**
Expand Down