All Projects → zhengjunxin → Wx Queue Request

zhengjunxin / Wx Queue Request

Licence: mit
控制微信小程序 wx.request 并发请求数量

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Wx Queue Request

Wx Promise Request
解决微信小程序 wx.request 请求的并发数限制、不支持异步问题
Stars: ✭ 226 (+247.69%)
Mutual labels:  queue, request
Wxapp Tutorial Api
Stars: ✭ 60 (-7.69%)
Mutual labels:  wxapp
Tasktiger
Python task queue using Redis
Stars: ✭ 1,053 (+1520%)
Mutual labels:  queue
Cdcontainers
Library of data containers and data structures for C programming language.
Stars: ✭ 57 (-12.31%)
Mutual labels:  queue
Sudolite
一款轻巧、趣萌、界面精美,具备统计、排行(即将推出),开源、免费、无广告的数独小程序
Stars: ✭ 52 (-20%)
Mutual labels:  wxapp
Wepy Calendar
微信小程序/wepy/日历组件
Stars: ✭ 58 (-10.77%)
Mutual labels:  wxapp
Laravel Elasticbeanstalk Queue Worker
Stars: ✭ 48 (-26.15%)
Mutual labels:  queue
Buckets Js
A complete, fully tested and documented data structure library written in pure JavaScript.
Stars: ✭ 1,128 (+1635.38%)
Mutual labels:  queue
Social Media Profile Scrapers
Fetch user's data across social media
Stars: ✭ 60 (-7.69%)
Mutual labels:  request
Fable.simplehttp
Http with Fable, made simple.
Stars: ✭ 57 (-12.31%)
Mutual labels:  request
Queue
PHP bindings for Tarantool Queue.
Stars: ✭ 55 (-15.38%)
Mutual labels:  queue
Geeksforgeeks Dsa 2
This repository contains all the assignments and practice questions solved during the Data Structures and Algorithms course in C++ taught by the Geeks For Geeks team.
Stars: ✭ 53 (-18.46%)
Mutual labels:  queue
Alagarr
🦍 Alagarr is a request-response helper library that removes the boilerplate from your Node.js (AWS Lambda) serverless functions and helps make your code portable.
Stars: ✭ 58 (-10.77%)
Mutual labels:  request
Redux Query
A library for managing network state in Redux
Stars: ✭ 1,055 (+1523.08%)
Mutual labels:  request
Docker Laravel Queue Worker
A docker image for working with queues being monitored by supervisor as recommended by laravel.
Stars: ✭ 60 (-7.69%)
Mutual labels:  queue
Wxapp Img Loader
适用于微信小程序的图片预加载组件
Stars: ✭ 1,049 (+1513.85%)
Mutual labels:  wxapp
Gulp Wxa Copy Npm
微信小程序gulp插件,解决npm包管理和babel-runtime
Stars: ✭ 55 (-15.38%)
Mutual labels:  wxapp
Neteasemusicwxminiapp
仿网易云音乐APP的微信小程序
Stars: ✭ 1,092 (+1580%)
Mutual labels:  wxapp
Yii2 Async
Provides translucent api & queues for moving large tasks out of request context with SQL, Redis or AMQP.
Stars: ✭ 64 (-1.54%)
Mutual labels:  queue
Qutee
PHP Background Jobs (Tasks) Manager
Stars: ✭ 63 (-3.08%)
Mutual labels:  queue

wx-queue-request

Build Status

管理微信小程序 wx.request 方法的并发数,解决请求数大于 10 时,直接不请求的问题。如果需要 wx.request 方法支持 Promise,可以使用 wx-promise-request 库哦。

下载

由于小程序不支持 npm,所以直接右键保存 index.js 文件即可。

使用

在 app.js 引入并执行即可

import { queue } from './wx-queue-request'
queue()

// 因为请求队列被管理
// 即使并发请求数超过 10 也不会报错了
wx.request({url: 'test.php'})
wx.request({url: 'test.php'})
wx.request({url: 'test.php'})
wx.request({url: 'test.php'})
wx.request({url: 'test.php'})
wx.request({url: 'test.php'})
wx.request({url: 'test.php'})
wx.request({url: 'test.php'})
wx.request({url: 'test.php'})
wx.request({url: 'test.php'})
wx.request({url: 'test.php'})

API

queue([concurrency])

直接对全局的 wx.request 进行封装,调用后 wx.request 即会管理队列。并发数默认为 10。

import { queue } from './wx-queue-request'
queue(5) // 指定并发数为 5

wx.request({url: 'test.php'})

queueRequest(request, [concurrency])

对指定请求函数进行封装,返回被管理队列的函数,并发数 concurrency 默认为 10。

import { queueRequest } from './wx-queue-request'

export default queueRequest(wx.request, 10)

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].