def create(path): unicorn = Service('unicorn') print 'creating node {}'.format(path) ch = yield unicorn.create_with(path, {}, dict(ephemeral=True)) # ch = yield unicorn.create(path, {}) _ = yield ch.rx.get() print 'creating done' yield gen.sleep(10) print 'node should be removed {}'.format(path) yield ch.tx.close()