0

https://developers.google.com/appengine/articles/deferredのこのコードはスレッドセーフですか? ( runtime: python27+で使用可能threadsafe: yes)

class GuestbookUpdater(Mapper):
    KIND = Greeting

    def map(self, entity):
        if entity.content.lower().find('foo') != -1:
            entity.content += ' Bar!'
            return ([entity], [])
       return ([], [])
  mapper = MyMapper()
  deferred.defer(mapper.run)

また、それは読むべきではありません

class GuestbookUpdater(Mapper):
    KIND = Greeting

    def map(self, entity):
        if entity.content.lower().find('foo') != -1:
            entity.content += ' Bar!'
            return ([entity], [])
       return ([], [])

mapper = GuestbookUpdater()
deferred.defer(mapper.run)
4

1 に答える 1