multithreading - How to make two python programs interact? -


I have broken a HTTP in a program and my original application is in both the other loops, so I do not know How to:

  1. Write a script that launches the app and then the HTTP server;
  2. Make these programs in Exchange data operations.

How are these things usually done? I actually include Python solutions because my scripts are written in Python.

  1. Does a user request an HTTP request that queries the app for some data and gives the result? Yes

  2. Does the app gather data and store it anywhere? Both the app and the HTTP server use the SQLite database, though DB may be different.

Before answering, I think we Some other information is needed:

  1. Is there a certain pipeline of information here?
    1. Does a user request an HTTP request that asks the app for some data and returns to the result?
    2. Does the app collect data and store it somewhere?

Depending on some options, how are you actually using them? Sockets have an option or passing information through a file or database.

[edit] Based on your answer, I think there are some ways you can:

  1. You can use the app's database from the server, so you can easily drag that information back to you later. Then it depends on what information is what you want to exchange.
  2. If your app only has to give an HTTP server to some servers, you can write them in a results table in the DB of the HTTP server.
  3. Use pipes or sub-processes because others have suggested to exchange data directly with the background app.
  4. Use a log file on which your app can write and your http server has read it.

Some other questions:

  1. Do you need two-way communication or is the HTTP server just showing results?
  2. Which webserver are you?
  3. On which processing language are you available?

How can depend on two parts dependent, it may be best to write a new app View your app's database for changes (hooks or voting or whatever) Post the release information in the HTTPS server's own database, it has the advantage of adding two parts less closely, which is often a good thing.

I've got a webserver (Apache 2) who talks to a degena app using the Fastcci module. have a look at . Apache uses sockets (or regular TCP) to talk to the background app (Django).

[Edit 2] Oh - Just been seen that your webserver is a python process if it's all dragon, then you can pass those two objects and these Both processes allow each other to send information in a blocked or non-blocking manner.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -