User Tools

Site Tools


programming:python:py-prefork-server

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
programming:python:py-prefork-server [2015/01/03 05:53]
jay [Hooks]
programming:python:py-prefork-server [2015/01/04 20:44]
jay [Downloading]
Line 21: Line 21:
 **NOTE:** The RPMs are **not** guaranteed to be the latest versions. ​ Check [[https://​github.com/​crustymonkey/​py-prefork-server|Github]] to find out what the latest version is.  That said, I will try and keep these up to date. **NOTE:** The RPMs are **not** guaranteed to be the latest versions. ​ Check [[https://​github.com/​crustymonkey/​py-prefork-server|Github]] to find out what the latest version is.  That said, I will try and keep these up to date.
  
-{{:​programming:​python:​py-prefork-server-0.1.2-1.noarch.rpm|py-prefork-server-0.1.4-1.noarch.rpm}} \\ +{{:​programming:​python:​py-prefork-server-0.1.2-1.noarch.rpm|py-prefork-server-0.4.0-1.noarch.rpm}} \\ 
-{{:​programming:​python:​py-prefork-server-0.1.2-1.src.rpm|py-prefork-server-0.1.4-1.src.rpm}}+{{:​programming:​python:​py-prefork-server-0.1.2-1.src.rpm|py-prefork-server-0.4.0-1.src.rpm}}
 ===== Donations ===== ===== Donations =====
 By no means should anyone feel they //have// to donate. ​ However, if you've used this stuff to save some time, prevent head shaped holes in the wall, raise your children or you just think this is awesome and want to contribute to my [[http://​www.surlybrewing.com/​|Surly]] fund (that stuff isn't cheap, but it's soooooo good), you can click the [[http://​paypal.com|Paypal]] donate button below and toss me a couple of dollars. ​ I've heard from others who have donated that they were visited by flying monkeys that spoke Icelandic, and were subsequently showered with fantastic gifts from said monkeys. ​ I don't know if this is true, or if drug use was involved, but it still sounds pretty awesome. By no means should anyone feel they //have// to donate. ​ However, if you've used this stuff to save some time, prevent head shaped holes in the wall, raise your children or you just think this is awesome and want to contribute to my [[http://​www.surlybrewing.com/​|Surly]] fund (that stuff isn't cheap, but it's soooooo good), you can click the [[http://​paypal.com|Paypal]] donate button below and toss me a couple of dollars. ​ I've heard from others who have donated that they were visited by flying monkeys that spoke Icelandic, and were subsequently showered with fantastic gifts from said monkeys. ​ I don't know if this is true, or if drug use was involved, but it still sounds pretty awesome.
Line 87: Line 87:
 == initialize(self) == == initialize(self) ==
 Rather than reimplementing __init__, which you can do instead, you can just override this and setup variables and such that you need to set up.  This is the recommended approach. ​ Note that this is only called once, when the class is initialized. ​ This is **NOT** called on each new connection. ​ Use ''​post_accept()''​ for that purpose. Rather than reimplementing __init__, which you can do instead, you can just override this and setup variables and such that you need to set up.  This is the recommended approach. ​ Note that this is only called once, when the class is initialized. ​ This is **NOT** called on each new connection. ​ Use ''​post_accept()''​ for that purpose.
 +
 +== pre_bind(self) ==
 +This hook is called before the main socket is created and bound to the ip:​port. ​ This is similar to the ''​initialize()''​ hook in the child class. ​ You can use this to set up global variables, etc.  Note that this will **only** be called if you are using reuse_port as the socket will be bound in the child process.
 +
 +== post_bind(self) ==
 +As you might have guessed, this is called right after the ''​accept()''​ socket has been created and bound. ​ Note that this will **only** be called if you are using reuse_port as the socket will be bound in the child process.
  
 == post_accept(self) == == post_accept(self) ==
programming/python/py-prefork-server.txt · Last modified: 2015/01/04 20:44 by jay