简体   繁体   中英

Pipe program stdout to a crossbar.io router

How can I send the stdout of a compilation process to a crossbar.io-Router?

I am working on a travis-like continuous-integration-system for compiling Github-hosted LaTeX documents/projects. The server receives a POST from Github and starts the compilation process. The compiler's output should then be displayed real-time in a virtual console on a website.

Is this possible with crossbar.io and autobahn|Python running on Debian?

Yes, possible. I estimate roughly 50 lines Python code + JS in browser (dump to JS console: 20 lines).

Here is what you need to do when using AutobahnPython plus Python 2 and Twisted :

  1. Write a Twisted Web resource that receives the HTTP/POST
  2. Upon receiving the POST, start a child process (your compiler thing) using Twisted's process support
  3. Upon receiving stuff from stdout from the child process, publish WAMP events to Crossbar.io via ..
  4. .. a WAMP app component that you previously created and connected to Crossbar.io

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM