[Tutor] Threaded persistance?

Kent Johnson kent37 at tds.net
Wed Mar 2 21:53:17 CET 2005

Gwyn Evans wrote:
> Hi,
>   New to Python, but with Java background  I'm interested in
> comments/suggestions for something I'm trying...
>   I've got a series of events (basically a dictionary of a few
> key:value pairs) which I'd like to forward onto a web service.  That
> should be no problem, but I'm investigating what I can do when the web
> service is down for a bit.
>   What I'm considering is to persist the event and trigger a seperate
> thread to retry the forwarding.  What I'm wondering about is if
> there's a storage method that allows 1 thread writing to the storage
> while the other thread reads and then deletes from the storage...

Do you need to allow for the sending thread to be restarted as well? In other words, does the queue 
have to be persistent? If not, you could use Queue.Queue which is intended for this kind of 
inter-thread communication.


More information about the Tutor mailing list