Questions tagged [asynccallback]

A callback is a piece of executable code that is passed as an argument to other code, which is expected to call back (execute) the argument at some convenient time. An asynchronous or deferred callback is invoked after a function returns, or at least on another thread’s stack.

A callback is a piece of executable code that is passed as an argument to other code, which is expected to call back (execute) the argument at some convenient time. An asynchronous or deferred callback is invoked after a function returns, or at least on another thread’s stack.

More Info

457 questions
0
votes
1 answer

callback error on second click

Everything is executing fine on first run. But, it gives the callback already called error on the second run. Thanks. Server Side Code: async.waterfall([ function(pcallback) { //var mykeyword = ""; //resultset=""; …
0
votes
1 answer

Async.js each continue without callback

Why async.js each still works without calling callback var async = require('async'); var arr = ['a', 'b', 'c', 1, 2, 3]; async.each(arr, function(item, callback) { console.log(item); }, function(error) { if (error) console.log(error); }); as…
Alex Ivasyuv
  • 8,585
  • 17
  • 72
  • 90
0
votes
1 answer

Weakreference get null in async task

I use Weakreferences for the callback in a asynctask. In the constructor of the asynctask i give a list with references. In my situation the list contains 3 references, 2 fragment references and 1 java class reference. When i check the list which is…
CodeNinja
  • 836
  • 1
  • 15
  • 38
0
votes
1 answer

NodeJS: async module: passing arguments

I'm trying to pass arguments into a function in a NodeJS async queue with a callback. I can pass one argument correctly, but it fails for two. Extract (abc is triggered by a HTTP POST request): var queue = async.queue(doStuff, 5); var abc =…
user3320795
  • 523
  • 2
  • 6
  • 17
0
votes
0 answers

JavaScript callbacks with asynchronous http request

So I know there is a better way to do this, but I can't, for the life of me, wrap my head around callback functions. Below is a general mock-up of my code, which is sharing a question title on facebook from a Q&A…
programmingmusic
  • 429
  • 1
  • 3
  • 13
0
votes
1 answer

Access firebase fireproof promise local variables in other promise functions in Node.js- avoid global

Below is the working code to access data form firebase. It uses global variable 'Data' array to send it to the final callback function. But I don't want to declare global variable. So is there anyway I can pass my data to every callbacks after it ?…
Kazim Homayee
  • 739
  • 6
  • 8
0
votes
1 answer

Callback - error after 2nd callback

I'm learning about callbacks and I wrote this code: var http = require('http'); var str = ""; var count = 2; function jugglingAsync(callback){ http.get(process.argv[count], function(response){ response.on("data", function(data){ …
DzikiChrzan
  • 2,747
  • 2
  • 15
  • 22
0
votes
1 answer

run a function when another function with an asynchronous event completes

I am working on a dynamic canvas animation that will load and animate multiple images. Seems I've run into a race condition, and I don't know how to resolve it. This object constructor loads the images, creates objects for them, and sets width and…
Mike Eng
  • 1,593
  • 4
  • 34
  • 53
0
votes
1 answer

javascript remove functions in async.parallel

this question may seem easy but I have 0 experience in javascript and got confused with the call-back functions. The original code was doing some "async.each" with "async.parallel" stuff. function fillMap(listElements, elementMap, params, callBack)…
JudyJiang
  • 2,207
  • 6
  • 27
  • 47
0
votes
2 answers

How to handle async callbacks from Model in the View model

This is a general quastion about handling callbacks in MVVM/MVC pattern. What ways there are to handle an asynchronous callback function from the Model in the Controller/View-Model. For example: I have a function in the model that start her work…
LamaTo
  • 540
  • 1
  • 8
  • 21
0
votes
0 answers

jQuery AJAX callback not working on Firefox

I'm using jQuerys AJAX functionality to send data to the server as posted below var updateTLC = $.ajax({ url : resourceUrl + "/update", type: 'POST', data : data, cache : false, dataType : 'json', …
alan oreilly
  • 69
  • 2
  • 7
0
votes
1 answer

AngularJS: Get $http response from function in module

how do i get the response from $http in from a function in a module? Angular module: // module customServices var customServices = angular.module("customServices", []); // object for response httpResponse = {content:null}; // function…
0
votes
0 answers

Executing a Parent callback function when child function completes - Javascript

I have a function that takes a callback as a parameter, this function has a child function inside of it that I need to actually execute the passed callback that was passed to the parent when it's (the child function) done. Example: function…
0
votes
1 answer

Not able to modify value in javascript callback

I am not able to modify the value of outputString variable inside callback. var outputString; client.get(key,function(err,value){ outputString = "key="+key+" value="+value ; …
Zack
  • 2,078
  • 10
  • 33
  • 58
0
votes
0 answers

Node JS wait for asynchronous listeners before returning

I'm working on this API and I need this function to return a responseObject, but the value needs to be set by asynchronous listeners before returning. The problem is that node js returns them immediately before the listeners have a chance to modify…