Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Creating topics for classified of broadcasting message... #52

Closed
YnievesDotNet opened this issue Sep 24, 2015 · 3 comments
Closed

Creating topics for classified of broadcasting message... #52

YnievesDotNet opened this issue Sep 24, 2015 · 3 comments

Comments

@YnievesDotNet
Copy link

Creating topics for classified of broadcasting message

Hello again.
Other things is about the creation of topics, of thread for sending message at one or more groups of recipients, for example, create some tags, example, notify.admins, chat.public, chat.private.{thread_id}, etc, and opened this threads from the javascript client, and validate this connect using php. For example:

use HoaTopic;
...
    public function getLogin()
    {
        HoaTopic::send('Login rendered', 'notify.admin');
        return view('auth.login');
    }
...

and in the class HoaWebSocket, or other, do this.

class HoaTopic extend HoaWebSocket {
    ...
    public function send($message, $topic) {
        $user = Sentinel::getUser();
        if ($topic == 'notify.admin') {
            if (!$user->hasAccess('admin')) {
                self::send('Access Denied at user '.$user->id, 'notify.admin');
                return;
            }
            $nodes = $bucket->getSource()->getTopics($topic)->getConnection()->getNodes();
            foreach ($nodes as $node) {
                $node->send($message);
            }
        }
    }
    ...
}

Thanks

YnievesDotNet

@Hywan
Copy link
Member

Hywan commented Sep 28, 2015

Hello :-),

Is it a new feature request? If so, I reckon this is not the goal of the Hoa\Websocket library to implement this. We do support the WebSocket protocol. Consequently we have listeners for message, binary-message etc. Channels are not part of the WebSocket protocol. However, it may be related to #26?

@YnievesDotNet
Copy link
Author

exactly, this is a feature wamp, and is related at issue 26. send one message at one specific client or group of clients. Like as Private Chat or Grouped Broadcasting, etc.

Thanks

YnievesDotNet

@Hywan
Copy link
Member

Hywan commented Sep 29, 2015

This can be accomplished by using nodes and the broadcastIf method. It can also be down by using WAMP but this latter protocol is not implemented yet.

@Hywan Hywan closed this as completed Oct 27, 2015
@Hywan Hywan removed the in progress label Oct 27, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants