Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running twistd with Pypy

I'm trying Pypy because it shows impressive benchmarks over CPython. Also, I'm mostly using the Twisted library in my code. I can now run a benchmark script which uses the Twisted reactor so I guess my setup is good. However, I do not know how to run the Twisted daemonizer (twistd) using Pypy.

like image 925
esamson Avatar asked Aug 25 '11 02:08

esamson


People also ask

What is twisted framework?

Twisted is an event-driven network programming framework written in Python and licensed under the MIT License.

How do I install twisted Python 3?

Installing Python-Twisted package on Linux using PIPStep 1: First of all, we will install Python3 on our Linux Machine. Use the following command in the terminal to install the latest version of Python3. Step 3: Now, install the Python-Twisted package with the help of the following command.

What is twisted library in Python?

Twisted is an open source network framework written entirely in Python. It allows you to create a SMTP, HTTP, proxy and ssh servers (and more) in Python with minimal effort.

What is twisted reactor?

The reactor is the core of the event loop within Twisted -- the loop which drives applications using Twisted. The event loop is a programming construct that waits for and dispatches events or messages in a program.


1 Answers

You can either do it explicitly at run-time:

~$ /usr/bin/pypy /usr/bin/twistd ...

This works because it specifically starts PyPy and tells it to start interpreting the twistd script.

Or you can do it persistently at install-time:

~/Twisted-11.0.0$ /usr/bin/pypy setup.py install

This works because distutils (what setup.py uses) rewrites the #! line of each script it installs to point to the interpreter used to do the installation. So #!/usr/bin/env python in the installation source becomes #!/usr/bin/pypy in the installed copy.

like image 103
Jean-Paul Calderone Avatar answered Oct 18 '22 12:10

Jean-Paul Calderone