On 10/12/07, est <[EMAIL PROTECTED]> wrote:
>
> I am writing a GTalk Bot running background on Debian, and I need a
> webservice e.g. http://xxxx.com/services/gtalktome.html
>
> when I post some text to http://xxxx.com/services/gtalktome.html I
> need transfer the text to someone with GTalk.
>
> So what is the best practise for such a service?
>
> I was previously working with Django and I can not find a static, long-
> running place to place the GTalk object, is there any solution in
> webpy? My django thread is here: 
> http://groups.google.com/group/django-users/t/9e652d3ad37338fc

My immediate was response was the same as some of the Django guys: the
GTalk stuff should live in a separate daemon.

Of course, there's nothing stopping you from creating a global GTalk
client at startup and continuing to use it.  The easiest way is to
just create it before you call web.run().  That may be fine if you're
just looking for something simple, but there are many pitfalls to fall
in.  Here are two off the top of my head:
  * Beware web.py's reloader middleware.  Reloading modules can
confuse fragile libraries.
  * If anything in your GTalk code isn't threadsafe, Bad Things Will
Happen.  Even worse, thread safety issues often don't show up in
testing because you're not actually making multiple simultaneous
requests.  This is one of the advantages of moving the GTalk code into
its own daemon: you separate its threading issues from the web
application's, making both easier to deal with.

-- 
Gary
http://blog.extracheese.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to