Questions tagged [co]

The Co javascript library for generator based flow-control of asynchronous tasks

Co is a javascript library for executing generators that yield asynchronous tasks, so that asynchronous code can be written in a more concise manner.

114 questions
0
votes
1 answer

"TypeError: object is not a function"

I don't know where this is coming from, version 4.0 of CO is installed and 0.11.14 version of Node. Very simple code which worked on 3.1 (just noticed the previous version of co is different) "use strict" const co = require('co') const main =…
akaphenom
  • 6,191
  • 9
  • 55
  • 99
0
votes
2 answers

Copy/Paste Specific Columns from a Worksheet to another

I want to copy some columns with headers from a worksheet to another one. I've created an array that looks for the different headers needed so I can copy and paste the entire column into the new tab. I know I have an error somewhere because I'm…
gssd
  • 13
  • 3
0
votes
2 answers

c++ - trying to insert node into vector but program keep crashing at push_back

So I inputted bunch of strings into a linkedlist. I tend try to input these nodes into vector. But program just kept crashing whenever I try to push_back. Here is my code. I have two class, node and heap. heap h; vector *vstring; After…
whatislife
  • 61
  • 6
0
votes
1 answer

wrapping co and co-mysql from within a generator function, and yielding out of the wrapping function

I am having trouble understanding co and how to leverage its functionality inside of another generator. Essentially I have a generator that needs to perform a SQL query, then do something complicated with each row before Yielding them out to the…
akaphenom
  • 6,191
  • 9
  • 55
  • 99
0
votes
1 answer

How to turn non-idiomatc nodejs callback into thunk?

I'm using the Firebase node module and trying to convert it's callbacks to thunks to be able to use them in Koa. This is the original event listener callback as per the Firebase documentation: projects.on('value', function (snapshot) { …
Alfred
  • 7,002
  • 3
  • 23
  • 35
0
votes
1 answer

Wrap library with thunkify for co

I was wondering how to thunkify (wrap in thunk) a library for use with co. The library is like the following. All the Client calls use other objects in the library. Library.Client = function(opts) { } Library.Client.prototype.createList =…
dre
  • 1,359
  • 2
  • 19
  • 30
0
votes
2 answers

Trying to `yield` to a `co( fn ).call`

I'm having a problem getting co to resume when also changing it's context value: var co = require( 'co' ); function *foo( next ){ console.log( 'foo yielding' ); yield next; console.log( 'foo yielded' ); return 42; } var bar = co(…
Mark Kahn
  • 81,115
  • 25
  • 161
  • 212
-1
votes
1 answer

Node Coroutines Parallel Flow Control with Generators and Promise

I am trying to mimic the control flow of the async.js library with coroutines and promises,using both co and bluebird.js but I am running into some issues. My code is as follows, although this is mostly psuedo code, because actual code would've been…
John M.
  • 119
  • 1
  • 9
-2
votes
1 answer

codeigniter sends mail in spam

I am using the following code to send mail but the sent mail are going in spam. How can I mark them to not spam programatically $this->load->library('email'); if($this->config->item('protocol')=="smtp"){ $config['protocol'] = 'smtp'; …
Rohitashv Singhal
  • 4,261
  • 13
  • 48
  • 100
1 2 3 4 5 6 7
8