mcollina / fastq

Fast, in memory work queue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to use with redux-saga?

jingyuLin1999 opened this issue · comments

could support function* worker

const mqQueue = require('fastq')({ select, fork }, worker, 1);
  eventbus.on(configs.topic_tools_status + configs.factoryCode + '_' + configs.shopCode.toLocaleUpperCase(), (msg) => {
      if (msg.Type_Data == 101 || msg.Type_Data == 106) mqQueue.push(msg) 
  })
  function* worker(arg, cb) {
      let bbb = this.select((state) => {
          return state.tools3Test
      });
      console.log(bbb)
      // yield put({ type: "consumerQueue", payload: { arg, cb } })
      cb(null, arg)
  }

I'm a bit lost on who will receive the data that is going to be yielded.