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 7541315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:51:37+00:00 2026-05-30T07:51:37+00:00

Ubuntu 11.10, Python 2.6. Background: I have an existing Python app that is using

  • 0

Ubuntu 11.10, Python 2.6. Background: I have an existing Python app that is using Twisted to sit in a loop and wait for RESTful commands to come in. So the app starts up, kicks off threads that do various things, and main sets up callbacks for Twisted, then calls Twisted.reactor.run(), which blocks forever. When a request comes in, the appropriate handler is called, stuff happens, a reply is sent back.

My job is now to remove Twisted because management has decided they don’t like it. We’re moving to Apache as our web server.

Using the documentation, I have successfully installed and configured Apache2.0 to serve web pages. I also installed mod_wsgi, and was able to configure it and Apache to execute arbitrary Python code when a request comes in. So I’m good on that side.

What I’m missing is how to connect my Python application to the Apache/mod_wsgi bits, since the application needs to be persistent and always running. It was suggested that I open a pipe between my wsgi script and my main application, and serialize the requests that way. But it seems like this is something that should already be out there, I just don’t know enough to know what to search for.

Any pushes in the right direction are greatly appreciated.

Further edit for clarity: I’m not making a webserver. The application in question is a host app that is running on a virtual machine. It happens to be controlled by a RESTful interface via HTTP. So all it needs to do is be able to listen for incoming commands and reply to them.

mod_wsgi may not be the proper tool for this job, which is fine, I just don’t know what is.

  • 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-30T07:51:38+00:00Added an answer on May 30, 2026 at 7:51 am

    It was suggested that I open a pipe between my wsgi script and my main application, and serialize the requests that way.

    That’s what multiprocessing queues are for.

    http://docs.python.org/library/multiprocessing.html

    http://docs.python.org/library/multiprocessing.html#pipes-and-queues

    You’ll be even happier if you start using Celery.

    Celery will allow you to “remove Twisted because management has decided they don’t like it.”

    However. Switch to celery means that things like “So the app starts up, kicks off threads that do various things, and main sets up callbacks for Twisted, then calls Twisted.reactor.run(), which blocks forever” all have to be completely rethought. Instead of some main polling loop, you now have multiple, independent processes that are coordinated by celery.

    What you’ll find is all the housekeeping in your application — all the coordination among threads — the callbacks — all that — will go away. You’ll be left with a few Python scripts that do the “real work” and Celery to manage the distributed task queue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: I am using Ubuntu The newer python version is not in the apt-get
I am running an Ubuntu 8.10, using Python 2.5 out of the box. This
Today I ran a bunch of doctests using Python 2.6 on a Ubuntu 9.10
I am learning Python (I have a C/C++ background). I need to write something
I want to write a programme (in python) on Linux (Ubuntu Linux 9.10) that
I am using Apache/2.2.8 (Ubuntu) mod_python/3.3.1 Python/2.5.2 and I would like to preload the
Using: Ubuntu 11.04 Django 1.3 Python 2.7 Following the tutorial at Writing your first
I have a Python/Django Ubuntu server (have all the tools of Python and Ubuntu
I would like to retrieve multiple log files from an Ubuntu server (using Python
I use python based as well as rails applications on ubuntu linux. We have

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.