mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-08-29 02:05:38 +00:00
26 lines
405 B
Python
26 lines
405 B
Python
|
|
import uwsgi
|
|
|
|
current_node = 0
|
|
|
|
def application(e,s):
|
|
|
|
global current_node
|
|
|
|
nodes = uwsgi.cluster_nodes()
|
|
print nodes
|
|
|
|
if len(nodes) == 0:
|
|
print "no cluster node available"
|
|
raise StopIteration
|
|
|
|
if current_node >= len(nodes):
|
|
current_node = 0
|
|
|
|
node = nodes[current_node]
|
|
|
|
for part in uwsgi.send_message(node, 0, 0, e, 0, e['wsgi.input'].fileno(), uwsgi.cl()):
|
|
yield part
|
|
|
|
current_node+=1
|