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

The Archive Base Latest Questions

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

I have a python process running in the background. It’s a subprocess.Popen() call started

  • 0

I have a python process running “in the background”. It’s a subprocess.Popen() call started in a totally different process. As I’ve implemented it so far, the two processes are using multiprocessing.connections.(Listener|Client) to communicate with eachother. But I’m open to any way to accomplish the following.

What I want to do is have the “listener” background process use std(in|out|err) as if they’ve come from the “client” process. Streaming is important so that io isn’t read into memory but is read and written efficiently but also to avoid blocking on the listener process. I guess that means I need a lower-level access or some sort of async/threading/multiprocessing solution. That’s what I’m unclear on how do to. For example:

while True:  # TODO
    conn = listener.accept()
    try:
        callable_, args, kw = conn.recv()
        callable_(*args, **kw)

The question is how to allow callable_ to execute streaming to/from std(in|out|err) efficiently and without blocking. The listener is also long-running, and I’m trying to support arbitrary python code that does from sys import std(in|out|err) at listener module import time will still see std(in|out|err) as if from the client. I can do setup (modifying/replacing sys.std(in|out|err)?) at listener startup before anything else is impored.

Is there a good way to stream this io transparently such that after initial setup the code being run by the listener process can be arbitrary and can treat std(in|out|err) normally without blocking, etc.? Preferably without creating new processes since the goal is to reduce process overhead, though using multiple processes on the client end is preferable since the client is thin. Similarly, if I have to loop over reads/writes of segments of bytes from std(in|out|err) to accomplish effective streaming it would be best to do it in the client.

  • 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-24T22:37:31+00:00Added an answer on May 24, 2026 at 10:37 pm

    I’m not entirely sure I understand the question, but have you looked into using select with pipes/sockets to avoid blocking? I’m a bit vague on the other req that it “not be read into memory.”

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

Sidebar

Related Questions

I have a python web application that needs to launch a long running process.
i have created a running process which listens for input: listen = Popen([home/user/listen], stdout=PIPE,
I am planning to make a long running background process with Python but I
So I have a domain and I need to keep a python process running
I have a process id in Python. I know I can kill it with
I have a complex build process to generate a couple of python extension modules
I am trying to get started with scons . I have Python 3.0.1 and
Here's a simple python daemon I can't manage to run as a background process:
We have several Python 2.6 applications running on Linux. Some of them are Pylons
I have a python process (Pylons webapp) that is constantly using 10-30% of CPU.

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.