Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6188407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:13:34+00:00 2026-05-24T02:13:34+00:00

How can I implement a system that can push messages to clients when necessary?

  • 0

How can I implement a system that can “push” messages to clients when necessary?
Basically, what I need is the ability to “push” text to Python clients from a Python server. The text will then be parsed to actions that will take care at the client side (I already know how to do this thing, once an ‘action-text’ is received).
I can check every couple of seconds for new ‘action-texts’ that are waiting — it’s just I don’t think it’s reliable and scalable to thousands of clients. The real-time thing is very important here.

Any suggestions, please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T02:13:36+00:00Added an answer on May 24, 2026 at 2:13 am

    I’d suggest having each client establish a socket connection to the server. Each client can run a thread that attempts a blocking read from the socket (put it in a background thread) that pulls information off the socket when it’s available. Then, whenever the server writes to that socket the client should get it immediately. The client’s connection should subclass telnetlib.telnet imho, because it provides a convenient read_until method. Something like this maybe:

    class RPCConnection(object, Telnet):
      def __init__(self, host = 'localhost', port = 9198, auto = True):
        Telnet.__init__(self)
    
        self.host, self.port, self.connected = host, port, False
    
        if auto:
          self._connect()
    
      def _connect(self):
        self.open(self.host, self.port)
    
        self.connected = True
    
      def _disconnect(self):
        self.close()
    
        self.connected = False
    
      def _send(self, dict):
        self.write(json.dumps(dict))
    
      def _recv(self):
        resp = self.read_until('\n')
    
        try:
          return json.loads(resp)
        except Exception, e:
          print e
          print resp
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to implement a notification mechanism for a system that has one manager
I would like to implement a ORM-style system that can save updates to POJOs
I'm looking for suggestions on possible IPC mechanisms that I can implement in my
DUPE: Any Yahoo YUI validation framework that I can implement in asp.net MVC? Has
How can I implement the following in python? #include <iostream> int main() { std::string
I am looking to implement a MongoDB system that has 3 major collections (People,
I have a requirement to implement a batch processing system that will run outside
I have the need to create a plugin system that will have dependency support
I'm trying to implement my own autocomplemention system (result is pull from an sqlite
I really like the way gmail has the archive system implemented. I can archive

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.