Questions tagged [dispatch]

Dynamic dispatch (also known as dynamic binding) is the process of mapping a message to a specific sequence of code (method) at runtime. This is done to support the cases where the appropriate method cannot be determined at compile-time (i.e. statically).

Dynamic dispatch is only used for code invocation and not for other binding processes (such as for global variables) and the name is normally only used to describe a language feature where a runtime decision is required to determine which code to invoke.

This Object-Oriented feature allows substituting a particular implementation using the same interface, and therefore it enables polymorphism.

http://en.wikipedia.org/wiki/Dynamic_dispatch

974 questions
0
votes
1 answer

JS dispatch event

I am trying to focus on a link with a given index using js dispatch event: var link = document.querySelector(".navbar-nav > li:nth-child(" + index + ") > a"); var event = new Event("focus"); link.dispatchEvent(event); The code above won't work…
sdvnksv
  • 9,350
  • 18
  • 56
  • 108
0
votes
1 answer

Import ReactiveCocoa, or PromiseKit, or BrightFutures as sources?

I have an OSX project (xcode plugin) and I want to use the ReactiveCocoa paradigms in it (PromiseKit andBrightFutures` are the other implementations of the same paradigms so I need to import at least one from these 3 frameworks/libraries). The…
Vyachaslav Gerchicov
  • 2,317
  • 3
  • 23
  • 49
0
votes
0 answers

How to manage multiple http requests rely on another individual request's response?

I have multiple http requests, but they must combine one parameter named "accessToken" which rely on another individual request's response to send the server. For example, I have request1,request2,request3,request4,request5 ,maybe more and more…
Hilen
  • 761
  • 7
  • 8
0
votes
1 answer

Why dispatch_sync on main thread cause deadlock but NSBlockOperation doesn't?

As the title, dispatch_sync() on main queue and main thread will cause deadlock, like that: dispatch_sync(dispatch_get_main_queue(), ^{ NSLog(@"%@", [NSThread currentThread]); }); But NSBlockOperation will not cause deadlock: NSBlockOperation…
0
votes
1 answer

Updating the main View from a background thread - Swift

When I press a button I start a loop of calculations and need to be able to update the main view as it progresses. As this is a background thread the screen doesn't update until the call has completed. How do I achieve this in Swift? This is my…
Edward Hasted
  • 3,201
  • 8
  • 30
  • 48
0
votes
1 answer

Wait the function run finish only get the data

I have a function that get data from server and it will run asynchronous while other function is running. my problem, i called the function [self getdata] at viewdidload(). and NSLog at below the called function but the data is delay. it get null.…
user4302196
  • 93
  • 1
  • 6
0
votes
2 answers

dispatch_apply gives incorrect output data

I have two arrays: array1 and array2. Each object of arrays is an array too (2D arrays). In this way I multiple them. So how I have big arrays I use dispatch_apply. Every time i receive different results include a right result. Maybe somebody knows…
0
votes
1 answer

findObjectsInBackgroundWithBlock in dispatch block doesn't called

I'm trying to call below parse retrieving method in another dispatch block but it never calls. I'm suspect calling a block in another block doesn't allowed but not sure. Does anybody have any idea about why findObjectsInBackgroundWithBlock isn't…
mehmeet43
  • 183
  • 15
0
votes
0 answers

How to delete the action inside closure after using dispatch_after function?

I'm using a dispatch function to delay the action in my code: dispatch_after(dispatch_time( DISPATCH_TIME_NOW, Int64(10 * Double(NSEC_PER_SEC)) ), dispatch_get_main_queue(), { () ->…
Hieu Duc Pham
  • 1,074
  • 1
  • 10
  • 24
0
votes
1 answer

Dispatching ViewPager touch events to underlying view

I have a ViewPager that has 2 pages. On 1 of them there is a custom view along with some other widgets. What I want is to disable paging if the touch event was used by that custom view. Here's the relevant code from my custom view: class…
0
votes
1 answer

Scala: Dispatch

I'm willing how to implement an extensible dispatch mechanism in Scala. For example: I have a trait called Sender (with a method 'send') and a bunch of classes that implement that trait (MailSender, IPhoneSender, AndroidSender). On top of them there…
0
votes
0 answers

Java Jacob COM Bridge: cyclic dispatch.call(...) gets slower and slower on each call

I have a problem using the method: Dispatch.call(….). This Method is called cyclic (every second). The problem is that each call lasts longer. So after about 100 cycles the duration has doubled. Here are some details: I am using Jacob Com Bridge in…
Andreas
  • 1
  • 2
0
votes
0 answers

Getting ClassNotFoundException while setting up Spring 4.0 Simple project Setup

I'm setting up a simple project with Spring 4. I'm not using Maven. Instead I've simply added the Spring Dependencies by adding the Jars to the classpath. I'm using RAD 8.5 and Websphere 8.5 for this project. When I am trying to start up the…
0
votes
1 answer

Push queue, modules and dispatch file

I'm passing messages to a push queue (url="/push/ios") and I have a dispatch file that handles /push/* to my push module. Yet, the URL is re-routed towards my default module, while it works fine if I curl myapp.appspot.com/push/ios. The doc seems to…
apassant
  • 167
  • 3
  • 11
0
votes
0 answers

NFC - How to tell Application not to follow the usual intent?

I am writing an App that starts when a Tag with plaintext is read. It takes the integer saved on it to search in a database for some stuff. I like it that it starts and searches automatically, but i have one problem: The App has an Activity to…
NewOutlaw
  • 64
  • 8