Last active
December 18, 2015 22:28
-
-
Save philipcristiano/5854424 to your computer and use it in GitHub Desktop.
gunicorn worker hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import time | |
def post_worker_init(worker): | |
_send_udp('200 OK\n') | |
def _send_udp(message): | |
udp_ip = "127.0.0.1" | |
udp_port = 4012 | |
sock = socket.socket(socket.AF_INET, # Internet | |
socket.SOCK_DGRAM) # UDP | |
sock.sendto(message, (udp_ip, udp_port)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment