标签: python-huey

现在Celery 4已经放弃了Windows支持,Windows上(Python 3)任务队列的最佳选择是什么?

我们在Windows下的IIS下运行Flask站点,对于进程外任务,我们使用Celery.Celery在Windows下给了我们一些问题,但是现在我们很满意运行版本3.1.12,使用RabbitMQ/AMQP作为后端,它可以在Windows下运行.

新版Celery(4)已经放弃了对Windows的支持,所以我正在寻找一种可行的替代方案.

RQ似乎是一个非常好的任务队列,但它也不支持Windows(页面底部)

我已经看到了一些看起来不太受欢迎的任务队列,例如:

但目前还不清楚这些是否支持Windows和Flask.我想知道是否有人有经验在Windows下运行Python任务队列的经验.也许我提到的那个之一,或者另类.

我们不能选择运行Linux机器,因为我们没有管理Linux的经验,而且我们有许多需要Windows运行的遗留内容.

python queue celery flask python-huey

19
推荐指数
1
解决办法
4812
查看次数

huey消费者配置在哪里?

我正在尝试为python运行Huey任务队列(这是Celery的替代方案)而且我坚持用main.Configuration启动使用者(正如它在教程中所写的那样).我知道huey_consumer正在python中的某个地方寻找配置文件,但是根据教程我不能让它工作,我不知道为什么我应该编写配置文件并将其作为模块(而不是文件)加载.

当我运行huey_consumer.py main.Configuration它返回Unable to import "main".

休伊也把这个问题写成了他们共同的问题,但它也没有真正帮助.

如果有人使用Huey,请帮助我.

python django task-queue python-huey

7
推荐指数
1
解决办法
1066
查看次数

监控 Huey(Redis 队列、队列中的时间和工作人员数量)

为休伊换了芹菜,我喜欢它的一切:)

Celery 有一件我很怀念的事情是它的花卉监控工具。是否有适用于 Huey 的监控工具?

我们需要跟踪 Redis 队列中的任务数量、任务在被工作人员接收之前进入队列所花费的总时间,以及正在运行的工作人员数量。

是否有任何 Huey 钩子可以帮助解决这个问题?

我已经查看了 Huey 事件,但它们似乎只有在消费者接受任务后才会触发。

我现在的计划是:

  1. 当任务被排队时,将时间戳作为参数传递给任务,然后我可以将它与工作人员从队列中拉出的时间戳进行比较。这将获得排队时间。

  2. 我可以创建一个服务,在 Redis Huey 队列上调用 LLEN 来跟踪作业。

  3. 我不确定获得# 工人的最佳方式。理想情况下,如果我们的任务队列达到一定长度,我们希望增加 Huey 工作线程的实例数量。

有没有人有监控 Huey 的经验?我在文档中遗漏了什么可以帮助这个过程?

python-huey

7
推荐指数
1
解决办法
1075
查看次数

OSError: [WinError 10013] 尝试以访问权限禁止的方式访问套接字

我正在尝试使用 Huey 作为跨平台任务队列。我找到了https://github.com/pjcunningham/flask-huey-example,我已经克隆并设置了一个 virtualenv 来使用 conda (我正在 Windows 上工作)。我已按照更新的自述文件进行操作,并设法让所有三个窗口运行而不会出现错误。但是,当我打开http://localhost:6060/时

[![在此处输入图像描述][2]][2]

我单击发送按钮,这会破坏 Huey_consumer 进程:

$ python ...envs/hueytest1/Scripts/huey_consumer.exe run_huey.huey
[2018-08-06 10:19:25,949] INFO:huey.consumer:MainThread:Huey consumer started with 1 thread, PID 1704
[2018-08-06 10:19:25,949] INFO:huey.consumer:MainThread:Scheduler runs every 1 seconds.
[2018-08-06 10:19:25,949] INFO:huey.consumer:MainThread:Periodic tasks are enabled.
[2018-08-06 10:19:25,950] INFO:huey.consumer:MainThread:UTC is enabled.
[2018-08-06 10:19:25,950] INFO:huey.consumer:MainThread:The following commands are available:
+ send_async_email
+ dummy_task
[2018-08-06 10:19:39,743] INFO:huey.consumer.Worker:Worker-1:Executing queuecmd_send_async_email: ba5e092d-b1de-41cd-8b27-72d11c2b13d8
[2018-08-06 10:19:40,766] ERROR:huey.consumer.Worker:Worker-1:Unhandled exception in worker thread
Traceback (most recent call last):
  File "...\envs\hueytest1\lib\site-packages\huey\consumer.py", line 153, …
Run Code Online (Sandbox Code Playgroud)

python flask flask-mail python-huey

6
推荐指数
1
解决办法
3万
查看次数

Hue安装问题

我是bigdata技术/ hadoop生态系统的新手.

作为我的任务之一,我正在尝试在我的单节点hadoop集群[apache distribution hadoop2.6.0]上安装和运行Hue.

我按照许多网站提供的说明安装了hue:

  1. 下载最新的hue tar文件
  2. 在一个位置解压缩
  3. sudo make install
  4. 它在/ usr/local/hue目录中安装了hue
  5. 更新了hue.ini文件,其中包含我的群集的所需详细信息.
  6. 当我尝试使用':8888'通过Web UI访问新安装的hue时,它显示以下错误页面:
Traceback (most recent call last):
  File "/usr/local/hue/desktop/core/src/desktop/lib/wsgiserver.py", line
Run Code Online (Sandbox Code Playgroud)

1198,在沟通req.respond()文件"/usr/local/hue/desktop/core/src/desktop/lib/wsgiserver.py",第568行,在响应self._respond()文件"/ usr/local/hue/desktop/core/src/desktop/lib/wsgiserver.py",第580行,在_respond response = self.wsgi_app(self.environ,self.start_response)文件"/ usr/local/hue/build/env/lib /python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/handlers/wsgi.py",第206行,正在通话中 response = self.get_response(request)File"/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/handlers/base .py",第194行,在get_response response = self.handle_uncaught_exception(request,resolver,sys.exc_info())File"/usr/local/hue/build/env/lib/python2.6/site-packages/Django- 1.6.10-py2.6.egg/django/core/handlers/base.py",第236行,在handle_uncaught_exception中返回回调(request,**param_dict)文件"/ usr/local/hue/desktop/core/src/desktop/views.py",第304行,在serve_500_error中返回render("500.mako",request,{'traceback':traceback.extract_tb(exc_info [2])})文件"/ usr/local/hue/desktop/core/src/desktop/lib/django_util.py",第225行,在渲染**kwargs)文件"/usr/local/hue/desktop/core/src/desktop/lib/django_util.py",第146行,在_render_to_response中返回django_mako.render_to_response(模板,*args,**kwargs)文件"/usr/local/hue/desktop/core/src/desktop/lib/django_mako.py",第125行,在render_to_response中返回HttpResponse(render_to_string(template_name,data_dictionary),**kwargs)文件"/ usr/local/hue /desktop/core/src/desktop/lib/django_mako.py",第114行,在render_to_string_normal中= template.render(**data_dict)文件"/usr/local/hue/build/env/lib/python2.6/ site-packages/Mako-0.8.1-py2.6.egg/mako/template.py",第443行,在渲染返回运行时中.第146行,在_render_to_response中返回django_mako.render_to_response(template,*args,**kwargs)文件"/usr/local/hue/desktop/core/src/desktop/lib/django_mako.py",第125行,在render_to_response中返回HttpResponse (render_to_string(template_name,data_dictionary),**kwargs)文件"/usr/local/hue/desktop/core/src/desktop/lib/django_mako.py",第114行,在render_to_string_normal result = template.render(**data_dict) )文件"/usr/local/hue/build/env/lib/python2.6/site-packages/Mako-0.8.1-py2.6.egg/mako/template.py",第443行,在渲染返回运行时.第146行,在_render_to_response中返回django_mako.render_to_response(template,*args,**kwargs)文件"/usr/local/hue/desktop/core/src/desktop/lib/django_mako.py",第125行,在render_to_response中返回HttpResponse (render_to_string(template_name,data_dictionary),**kwargs)文件"/usr/local/hue/desktop/core/src/desktop/lib/django_mako.py",第114行,在render_to_string_normal result = template.render(**data_dict) )文件"/usr/local/hue/build/env/lib/python2.6/site-packages/Mako-0.8.1-py2.6.egg/mako/template.py",第443行,在渲染返回运行时.在render_to_response中返回HttpResponse(render_to_string(template_name,data_dictionary),**kwargs)文件"/usr/local/hue/desktop/core/src/desktop/lib/django_mako.py",第114行,在render_to_string_normal result = template.render (**data_dict)文件"/usr/local/hue/build/env/lib/python2.6/site-packages/Mako-0.8.1-py2.6.egg/mako/template.py",第443行,在渲染返回运行时.在render_to_response中返回HttpResponse(render_to_string(template_name,data_dictionary),**kwargs)文件"/usr/local/hue/desktop/core/src/desktop/lib/django_mako.py",第114行,在render_to_string_normal result = template.render (**data_dict)文件"/usr/local/hue/build/env/lib/python2.6/site-packages/Mako-0.8.1-py2.6.egg/mako/template.py",第443行,在渲染返回运行时.第443行,在渲染返回运行时.第443行,在渲染返回运行时.渲染(self,self.callable,args,data)文件"/usr/local/hue/build/env/lib/python2.6/site-packages/Mako-0.8.1-py2.6.egg/mako/runtime .py",第786行,在_render**_ kwargs_for_callable(callable_,data))文件"/usr/local/hue/build/env/lib/python2.6/site-packages/Mako-0.8.1-py2.6 .egg/mako/runtime.py",第818行,在_render_context _exec_template中(inherit,lclcontext,args = args,kwargs = kwargs)文件"/usr/local/hue/build/env/lib/python2.6/site- packages/Mako-0.8.1-py2.6.egg/mako/runtime.py",第844行,_exec_template callable_(context,*args,**kwargs)文件"/tmp/tmpjqe8jG/desktop/500.mako. py",第103行,在render_body中 …

django hadoop django-models hue python-huey

2
推荐指数
1
解决办法
1444
查看次数

如何将 Huey 连接到 Flask 应用程序

我已经阅读了官方文档,但我不太确定我是否理解如何应用他们所说的内容。我也看过这个 QA,我也使用了工厂模式。只是看不到全貌。

  1. 连接池以及其他 redis/huey 设置可能会根据给定的环境(开发生产)而有所不同。我们如何连接huey以便我们可以像Flask应用程序一样配置它?

  2. 只要我了解从视图触发任务,我们就需要导入任务模块并调用特定任务(调用传递敏感参数的函数)。我们应该在哪里实例化,保留huey实例?

  3. 任务应该了解应用程序的依赖关系吗?对于这个问题,我们是否应该考虑另一个精简的Flask应用程序?

你能帮忙一点吗?

python windows flask python-huey

2
推荐指数
1
解决办法
3003
查看次数