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
2 answers

Angular2: Calling other functions inside call back functions

I am building an Angular2 application. I have an asynchronous function deleteObject in myService. It returns a Promise. I have another function in the Component called refresh, which refreshes the page. How do I call refresh from inside the Promise.…
UnderWood
  • 803
  • 3
  • 12
  • 23
0
votes
2 answers

assign external variable to the result of a callback inside AsynckTask

private class exampleTask extends AsyncTask{ @Override protected SomeResult doInBackground(String... urls) { SomeResult res ; someMethod(new CallBack(){ @Override public…
Aymane Bo
  • 59
  • 2
  • 11
0
votes
2 answers

Node.js how to iterate with async callback?

What I am doing is using fs to stitch 5 pieces of html-page parts(html, head, chead, topaside, main, footer) together. The file name is htmlpage.js, so you can just run node htmlpage.js file1 file2 file3 ... in command line tool, and it will stitch…
alexcres
  • 53
  • 2
  • 12
0
votes
1 answer

returning values from async scope in node js

I am definitely not seeing this straight so am looking for a quick hand. I've been googling about and not found much that has helped. Set the scene: I have a node app that uses the 'googleapis' package. Now, I have that working fine and returning…
0
votes
0 answers

(learning D3) How do I get my data back from a named function?

There is something I don't understand with d3. Let's say you have a json file, you're loading it like this : var url = 'http://localhost:5000/authors'; d3.json('http://url.com', function(data) { nestedData(data); }); then you have your function…
Simon Breton
  • 2,638
  • 7
  • 50
  • 105
0
votes
1 answer

Callback wait before executing next line

function GetFolders(callback) { var query = new CamlBuilder().Where().TextField("ContentType").EqualTo("Folder").ToString(); var hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl")); var scriptbase = hostweburl +…
Ali
  • 1,015
  • 14
  • 40
0
votes
3 answers

gelocation - asynchronous callback not working with error - Javascript

myFn.getMyCurrentPosition(data, function(data){ //Async call, need to use data like a callback - this section doesnt work. How can I use the current position coords and use it in a different function like a successfull callback? var myFn = { …
Loser Coder
  • 2,338
  • 8
  • 42
  • 66
0
votes
0 answers

JavaScript Callback Returning Undefined

I'm building an app in React Native and I'm having trouble understanding JavaScript callbacks. On a button click I'm getting a set number of images from a user's Camera Roll (in this case, 2), and sending them to a function to convert each image…
Onaracs
  • 935
  • 3
  • 14
  • 22
0
votes
1 answer

How to use a variable outside of function?

Hey guys I'm having trouble using the "appIds" variable outside the function scope, how can this be done? Here's the script below used in NodeJS: var appIds = []; request("http://api.steampowered.com/ISteamApps/GetAppList/v2?format=json",…
Kai
  • 89
  • 1
  • 6
0
votes
1 answer

Node.JS async callback

I have been using async module to manage my code flow and it's indeed a very powerful lib. However, as the code grows bigger and logical flow become more complex, I run into a problem with too many async_callback to manage. Some pseudo code to demo…
Lee
  • 2,874
  • 3
  • 27
  • 51
0
votes
3 answers

Break out of a "for" loop within a callback function, in Node.js

Regarding the code below, my goal is to break out of FOR LOOP B and continue with FOR LOOP A, but within a callback function. for(var a of arrA) { // ... // ... for(var b of arrB) { // ... // ... …
Brian
  • 310
  • 1
  • 4
  • 13
0
votes
1 answer

Node.js "Callback is already called". But there are no any other callbacks

I'm searching forum all the day, but I can't solve my problem. Im using NodeJS and async.waterfall to make some API requests. Same structure works for me, but not there; async.waterfall([ function (callback) { callback(null,…
Sergey
  • 45
  • 4
0
votes
0 answers

Using REST to Invoke JSON Custom Search API

I'm attempting to GET JSON data from the Google Custom Search API using javascript, but have been unsuccessful at retrieving the data. This is for a Chrome extension. I've read the Using REST article multiple times, but have still been having…
0
votes
0 answers

How to use ActiveUp.Net.Mail.SmtpClient to send email and check for bouce with AsyncCallback?

Busy creating a bulk mail system. need to understand how to send mail using MailSystem.Net ActiveUp.Net.Mail.SmtpClient class. I want to know that the message was delivered when the send process completes, or if it is bouncing back. How do I…
CypherNet
  • 53
  • 1
  • 10
0
votes
1 answer

Adding parameter to passed callback

**Made changes to example to correct a syntax error (all bold), thanks Luc DUZAN for the help. Changed c.target.result to the actual array used to hold the data 'objCollection' in the every last code example. Problem: I would like to add an…