> Hi All > > I know it was asked a lot but after hours of searching and trying several > posts, I couldn't find any solution to create a "long running" thread. > > The problem is, that my thread stops working, as soon as the client gets a > response from the server. > > So what I have is the following: > > - uwsgi == 1.9.17.1-debian > - nginx == 1.4.4 (Ubuntu) > > > class Mailer(object): > self._threads = [] > > def send(self): > ... > thread = Thread(target=self._send, args=(email_addr, > msg.as_string())) > thread.daemon = True > thread.start() > self._threads.append(thread) > ... > > def join(self): > return [t.join(5) for t in self._threads] > > def __del__(self): > self.join() > >
Taking in account this is not the best approach for this specific problem, how do you call the send method in the Mailer object from your WSGI callable ? -- Roberto De Ioris http://unbit.it _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
