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

Breaking the callback chain - Node

I am wondering if it's possible to assign the value of callback to a variable. I recently ran into a problem with MongoClient's connect method, where I want to get the db object and pass it on to my class methods. Is there a way I can I assign hello…
Yasin Yaqoobi
  • 1,888
  • 3
  • 27
  • 38
0
votes
1 answer

How to fetch all data from ngFor? Is any restrictions for fetching data into table with ngFor?

I have a Component which should create a record in DB through Service. @Component({ selector: 'app-add-company', templateUrl: './add-company.component.html', styleUrls: ['./add-company.component.css'] }) export class AddCompanyComponent…
Mike Cook
  • 15
  • 2
0
votes
0 answers

Getting callback result

I am writing a C# asynchronously library with delegate and callback to prevent blocking. I am also using a third-party library which is using the same callback methodology. How can I get the status from a the thrid party listener into my…
Alvin
  • 8,219
  • 25
  • 96
  • 177
0
votes
1 answer

JSON object not being passed to function

I have an application that allows csv file uploads, converts the csv to json via csvtojson and then imports the json into mongo db via mongoose. The vast majority of this works but for some reason I cannot get the import script to dynamically get…
Stuart Brown
  • 977
  • 2
  • 22
  • 47
0
votes
0 answers

Google Map unable to pull latlng from db, returns undefined

I'm trying to include googlemaps in my MEAN stack app. I have set up a googleMap directive and I'm pulling in the lat lng coordinates from some seeded test data. If I hard code the lat lng then the map renders however, pulling it in from the db I…
0
votes
1 answer

How can I update a member variable of a Javascript class with a value from MongoDB?

I have a job class, defined in Javascript as such: var Job = function() {}; module.exports = Job; I then define a member function using its prototype. That works fine, until I try to use a value from a database to set the member variable: // Create…
David van Driessche
  • 6,602
  • 2
  • 28
  • 41
0
votes
1 answer

How to pass value to completion handler in Swift?

I would like to pass a integer to a completion handler. Because the handler is asynchronous the value of count might be inaccurate by the time the completion handler gets a chance to run? I would like to pass the CURRENT value of count to the…
Lightsout
  • 3,454
  • 2
  • 36
  • 65
0
votes
4 answers

How to use getMapAsync() instead of getMap()

I am aware that in Play Services, getMap() is depreciated, and is replaced by getMapAsync(). But I am not sure how to use getMapAsync(). I found other questions similar to this -- however, in my code, I am not sure what to implement in my…
0
votes
1 answer

JavaScript: Pass new variable to default method

I'm writing a node application which uses a lot of promises. In an effort to keep my code readable I'm removing as many anonymous functions as possible and storing them in one JavaScript object like the following. let myCallbacks = { …
user316114
  • 803
  • 7
  • 18
0
votes
0 answers

C++ Multiple Object monitor on timeout

I am working on a solution where need to create around 30k objects for a class. Some actions are performed and it waits for some response. The object need to be monitor for timeout to check if response was not received and timeout happens. upon…
0
votes
1 answer

trigger event from an AsyncCallback in c#

My question involves events and where I am triggering the events in my class. This class wraps my TCP functionality and I am using TcpListener to achieve this. I realize some TCP stuff may be missing from the following example but I want to make…
Tom Fobear
  • 6,729
  • 7
  • 42
  • 74
0
votes
1 answer

Wrong margins when instantiate view in a callback iOS

Im having a problem with the UIView margins when Instantiating it on the callback function. When the view is instantiated like this it looks normal: let viewController = UIStoryboard(name: "Tracking", bundle:…
xpiero
  • 65
  • 7
0
votes
1 answer

Anonymous callback in JavaScript not working properly

I am trying to use an anonymous callback with JavaScript to run a function only once another is finished. In the first function getDisciplines() a $getJSON call is run which needs to complete before the getRounds() function is ran. This because the…
Jelle
  • 206
  • 4
  • 15
0
votes
1 answer

How to pass the value of the request.get to the callback using async.series node.js

I wanna show my code: request({url: API_URL}, function (error, response, body) { if (!error && response.statusCode == 200) { console.log("Items received with success."); var data = JSON.parse(body); // catch…
0
votes
2 answers

Variable "encontrado" has 'undefined' value after Callback function

I have this code: JavaScript: function foo(callback){ var producto = $("#inpt-producto").val(); var ajax = new XMLHttpRequest(); var url = "file_products.php"; // It will return 1 or 0 var params = "producto=" + producto; …
Gregory
  • 1
  • 2