pynit.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:pynit 作者: traverseda 项目源码 文件源码
def background(func):
   """
   Will run you function in the background.
   Please note that there are probably ways to abuse this to run code in the parent.
   In the future, we need to get a serilization method that isn't "pickle" running, for security.

   It returns a "Service" object, which right now is pretty much identical to a multiprocess.Process object

   TODO: Replace the built in pickle? serialization with something else. Maybe rpyc's brine.
   http://stackoverflow.com/a/13019405
   https://docs.python.org/2/library/multiprocessing.html#connection-objects
   """
   def func_wrapper(*args,**kwargs):
       p = Service(target = func, args=args, kwargs=kwargs, daemon = False)
       return p
   return func_wrapper
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号