Note that there are some explanatory texts on larger screens.

plurals
  1. POPython's Bottle & Long-Polling?
    primarykey
    data
    text
    <p>I currently have a one-page Bottle project working through <code>localhost:8080</code>. </p> <p>For the purposes of this question, assume that single page is naught but a basic short-polling chat, retrieving chatline objects from Python that contain only the sender's name and the body of the message.</p> <p>Those chatline objects are stored in chat objects, with the project allowing multiple chats. </p> <p>The chat and sender is determined by the URL. For example, if a chatline is sent from <code>localhost:8080/chat/23/50</code>, it is sent to chat 23 as sender 50, and <code>localhost:8080/chat/23/*</code> will display all chatlines of chat 23 in a basic <code>overflow:auto</code> div.</p> <p>The current short-polling AJAX requests data from Python once every second. I want to make things more real-time and have decided to go with long-polling (although if you love HTML5 WebSockets, I wouldn't mind learning about them too).</p> <p>My question is in two parts:</p> <ol> <li>How would I go about implementing a long-poll approach in such a chat system, preferably while still using Python's Bottle module?</li> <li>How would I then deliver the project through an actual server, accessible externally (i.e., not only from localhost)? Even making it available through LAN would be good.</li> </ol> <p>I'm aware that long-polling can cause severe performance issues with servers such as Apache and would appreciate it if that fact could be factored into any answers; I'd like as scalable a solution as possible.</p> <p>Any help is appreciated!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload