dynamic mounting/unmounting urls

41 views
Skip to first unread message

Iain C Docherty

unread,
Mar 23, 2014, 1:46:23 PM3/23/14
to psgi-...@googlegroups.com
We are using Plack::Builder to create a WebSocket server using Twiggy.

Currently we are mounting the Web Socket endpoints thus:-

    builder {
        mount "/ws/chat" => MyWebSocket::Chat->new({ server => 'Darwin' })->to_app;
        mount "/ws/app" => MyWebSocket::App->new({ server => 'Einstein'})->to_app;
        mount "/ws/app2" => MyWebSocket::App->new({ server => 'Newton'})->to_app;
    }

We are also doing the development on one server.

The design of the code is such that functionality is split with different functions (e.g. 'Chat' and 'App') which can easily be moved onto different servers as the usage increases.

We would also like to be able to replicate the same function across multiple back-end servers (e.g. several 'app' servers)

I want to be able to dynamically add and remove servers without affecting the users experience (e.g. add more 'chat' servers if the load increases) also the ability to take down one or more servers for maintenance would be useful.

I think I might be missing some key concepts here. I can't see an easy way to do this. Since it is a Web Socket server, once a connection is made to one of the back-end servers, it should persist until the connection is closed.

Are there any examples which do something similar that I could be referred to?

Kind Regards
Iain C Docherty.

Iain C Docherty

unread,
Mar 23, 2014, 1:49:57 PM3/23/14
to psgi-...@googlegroups.com
I should also add, we are hosting this on Linode, so the inclusion of specific hardware load balancing is not an option.

Iain C Docherty.

Carlos Salas

unread,
Nov 3, 2017, 1:31:37 PM11/3/17
to psgi-plack
Hi there, thanks for software plack I really Like this application, can you please Tatsuhiko Miyagawa, give a comment relation to this post:
https://stackoverflow.com/questions/776268/dynamic-cms-like-routes-in-ruby-on-rails/806516#806516
I really like to do this in plack, it is relation to this current post.

Thanks so much.
Reply all
Reply to author
Forward
0 new messages