On Wed, Feb 17, 2010 at 12:28 PM, ryan <[email protected]> wrote: > On Feb 7, 5:52 pm, Takashi Matsuo <[email protected]> wrote: >> >> For the time being, you can use following strategy for a workaround. >> 1) prepare a handler for sending particular mail >> 2) put this handler into the task queue in a transactional manner > > exactly! we actually don't even consider it a workaround, per se. it's > the recommended way to attach any API call or chunk of code to a > datastore transaction so that it's guaranteed to happen if the > transaction commits. > > it would take a significant amount of effort to attach another > individual API (like mail) to datastore transactions in the datastore > backend. given that, we chose to do just the task queue because it can > run arbitrary code, which means you can use it to make any API call > transactional.
Its nice to know the opinion from App Engine team! Agreed that using transactional task queue for other APIs is somewhat reasonable and reliable. Having said that, the strategy is still not perfect. In my opinion, the only problem is the task for sending mail is *not* idempotent. In other words, what if the task is executed more than once? Presumably recipients will receive more than one mail. Its somewhat annoying, isn't it? As far as I know, a background process in charge of managing and triggering tasks *can* mis-recognize that the task execution is failed while the execution is actually succeeded, right? If so, there is still a possibility for receiving redundant mails. Definitely things become better than before, but is still not perfect. I know its a very difficult problem, but could you please be aware of this room for improvement? Anyway, thanks for the great new release. Developers around me and I appreciate your efforts very much! > granted, enqueueing a task to run an API call does take a little extra > setup. if that's a concern, though, the deferred library mostly > addresses it: > > http://code.google.com/appengine/articles/deferred.html > > i think it might not compatible with transactional tasks quite yet: > > http://code.google.com/p/googleappengine/issues/detail?id=2721 > > but assuming that's true i expect we'll fix it soon. Its very good to know that you're aware of the issue I posted :) (because it was left as NEW state, so I was afraid it was ignored) Regards, -- Takashi Matsuo Kay's daddy > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" 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/google-appengine?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" 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/google-appengine?hl=en.
