Open wpjunior opened 12 years ago
a prototype:
from mongoengine import *
set_backend('async')
class Animal(Document):
nome = StringField()
def query_animals(animals, err):
print animals
Animal.objects(nome__startswith="M",
callback=query_animals,
timeout=30)
def new_macaco(macaco, err):
print macaco
Animal(nome="macaco").save(callback=new_macaco)
def distincts(nomes, err):
print nomes
Animal.objects.distinct('nome', callback=distincts)
def delete_boi(err):
print "deleted"
Animal.objects(nome="Boi").delete(callback=delete_boi)
for integration in async apps. Libs: https://github.com/facebook/tornado https://github.com/bitly/asyncmongo