Example #1
0
def update_carbon(signum):
    # connect to the carbon server
    carbon_fd = uwsgi.connect(CARBON_SERVER)
    # send data to the carbon server
    uwsgi.send(carbon_fd, "uwsgi.%s.requests %d %d\n" % (uwsgi.hostname, uwsgi.total_requests(), int(time.time())))
    # close the connection with the carbon server
    uwsgi.close(carbon_fd)
Example #2
0
import uwsgi

fd = uwsgi.connect("127.0.0.1:3033")

def application(e,s):

	for part in uwsgi.send_message(fd, 0, 4, e, 30, e['wsgi.input'].fileno(), uwsgi.cl()):
		yield part 
Example #3
0
import uwsgi

fd = uwsgi.connect("127.0.0.1:3033")


def application(e, s):

    for part in uwsgi.send_message(fd, 0, 4, e, 30, e['wsgi.input'].fileno(),
                                   uwsgi.cl()):
        yield part