2008年08月24日 星期日 20:18
this is very very great try! Collected into woodpecker.org.cn's wiki, sharing and enjoy this enhancement! http://wiki.woodpecker.org.cn/moin/KarrigellWithPyProcessingVeryGoodStrong On Sat, Aug 23, 2008 at 18:14, ccnusjy <ccnusjy在gmail.com> wrote: > > import os > import traceback > import sys > > import KarrigellRequestHandler > import k_config, k_utils > import webservers.SimpleAsyncHTTPServer as Server > from processing import Process, currentProcess, freezeSupport > if sys.platform == 'win32': > import processing.reduction # make sockets pickable/inheritable > > class > asyncRequestHandler(KarrigellRequestHandler.KarrigellRequestHandler, > Server.DialogManager): > > def handle_data(self): > > KarrigellRequestHandler.KarrigellRequestHandler.handle_data(self) > > def send_error(self, code, message=None): > > KarrigellRequestHandler.KarrigellRequestHandler.send_error(self, > code,message) > > def handle_error(self): > traceback.print_exc(file=sys.stderr) > > def kkk_serve(s): > #print k_config.silent > #if k_config.silent: > sys.stdout = k_utils.silent() > sys.stderr = k_utils.silent() > try: > s.loop() > except KeyboardInterrupt: > s.close_all() > k_utils.trace("Ctrl+C pressed. Shutting down.") > > def main_start(): > # Launch the server > port = 8086 > process_num = 3 > > s = Server.Server(('localhost',port),asyncRequestHandler) > > print "Karrigell %s running on port %s" % > (KarrigellRequestHandler.__version__, > port) > print "Press Ctrl+C to stop" > > for i in range(process_num): > child = Process(target=kkk_serve, args=(s,)) > child.setDaemon(True) > child.start() > > kkk_serve(s) > > if __name__ == '__main__': > if sys.platform == 'win32': > freezeSupport() > main_start() > --~--~---------~--~----~------------~-------~--~----~ > You received this message because you are subscribed to the Google Groups "karrigell" group. > To post to this group, send email to karrigell在googlegroups.com > To unsubscribe from this group, send email to karrigell+unsubscribe在googlegroups.com > For more options, visit this group at http://groups.google.com/group/karrigell?hl=en > -~----------~----~----~----~------~----~------~--~--- > > -- http://zoomquiet.org''' 过程改进乃是催生可促生靠谱的人的组织! PE keeps evolving organizations which promoting people be good!'''
Zeuux © 2024
京ICP备05028076号