e Aigle.

It is optimized for Promise handling and has almost the same functionality as neo-async.

Node.js

standard

$ npm install neo-async
var async = require('neo-async');

replacement

$ npm install neo-async
$ ln -s ./node_modules/neo-async ./node_modules/async
var async = require('async');

Bower

bower install neo-async

Feature

JSDoc

* not in Async

Collections

Control Flow

Utils

Mode

Benchmark

Benchmark: Async vs Neo-Async

How to check

$ git clone git@github.com:suguru03/async-benchmark.git
$ cd async-benchmark
$ npm install
$ node . // It might take more than one hour...

Environment

Result

Neo-Async is 1.27 ~ 10.7 times faster than Async.

The value is the ratio (Neo-Async/Async) of the average speed.

Collections

function benchmark func-comparator
each 3.71 2.54
eachSeries 2.14 1.90
eachLimit 2.14 1.88
eachOf 3.30 2.50
eachOfSeries 1.97 1.83
eachOfLimit 2.02 1.80
map 4.20 4.11
mapSeries 2.40 3.65
mapLimit 2.64 2.66
mapValues 5.71 5.32
mapValuesSeries 3.82 3.23
mapValuesLimit 3.10 2.38
filter 8.11 8.76
filterSeries 5.79 4.86
filterLimit 4.00 3.32
reject 9.47 9.52
rejectSeries 7.39 4.64
rejectLimit 4.54 3.49
detect 6.67 6.37
detectSeries 3.54 3.73
detectLimit 2.38 2.62
reduce 4.13 3.23
reduceRight 4.23 3.24
transform 5.30 5.17
sortBy 2.24 2.37
some 6.39 6.10
someSeries 5.37 4.66
someLimit 3.39 2.84
every 6.85 6.27
everySeries 4.53 3.90
everyLimit 3.36 2.75
concat 9.18 9.35
concatSeries 7.49 6.09

Control Flow

funciton benchmark func-comparator
parallel 7.54 5.45
series 3.29 2.41
waterfall 5.12 4.27
whilst 1.96 1.95
doWhilst 2.07 1.96
until 2.10 1.99
doUntil 1.98 2.04
during 10.7 7.09
doDuring 5.98 6.03
queue 1.83 1.75
priorityQueue 1.79 1.75
times 3.84 3.65
race 1.45 1.27
auto 3.23 3.50
retry 9.43 6.78
kodo - Gogs: Go Git Service

説明なし

custom_message.py 2.3KB

    # -*- coding: utf-8 -*- import logging from django.conf import settings from pywe_custom_message import send_custom_wxa_message from pywe_media import media_upload from pywe_storage import RedisStorage from pywe_subscribe_message import send_wxa_subscribe_template_message from pywe_template_message import send_template_message from utils.redis.connect import r WECHAT = settings.WECHAT logger = logging.getLogger('console') def mediaupload(media_file=None, media_file_path=None): wxcfg = WECHAT.get('JSAPI', {}) appid = wxcfg.get('appID') secret = wxcfg.get('appsecret') res = media_upload(media_file=media_file, media_file_path=media_file_path, appid=appid, secret=secret, token=None, storage=RedisStorage(r)) print(res) # 发送客服消息 - 发送小程序卡片 def sendcustomwxamessage(openid=None, miniappid=None, pagepath=None, thumb_media_id=None, title=None): wxcfg = WECHAT.get('JSAPI', {}) appid = wxcfg.get('appID') secret = wxcfg.get('appsecret') try: res = send_custom_wxa_message(openid=openid, miniappid=miniappid, pagepath=pagepath, thumb_media_id=thumb_media_id, title=title, appid=appid, secret=secret, token=None, storage=RedisStorage(r)) except Exception as e: logger.info(e) # 发送模版消息 def sendtemplatemessage(openid=None, template_id=None, data=None, url=None, miniappid=None, minipagepath=None): wxcfg = WECHAT.get('JSAPI', {}) appid = wxcfg.get('appID') secret = wxcfg.get('appsecret') try: res = send_template_message(user_id=openid, template_id=template_id, data=data, url=url, miniappid=miniappid, minipagepath=minipagepath, appid=appid, secret=secret, storage=RedisStorage(r)) return res except Exception as e: logger.info(e) return e # 发送订阅消息 - 小程序 def sendwxasubscribemessage(openid=None, template_id=None, data=None, miniprogram_state=None, lang=None, page=None): wxcfg = WECHAT.get('MINIAPP', {}) appid = wxcfg.get('appID') secret = wxcfg.get('appsecret') try: res = send_wxa_subscribe_template_message(user_id=openid, template_id=template_id, data=data, page=page, miniprogram_state=miniprogram_state, lang=lang, appid=appid, secret=secret, storage=RedisStorage(r)) return res except Exception as e: logger.info(e) return e