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

Symfony - Can't to find Event's Listener

I have a problem with Events in Symfony. I do not understand how way it works. This is my Listener: class ClientVisitedListener implements EventSubscriberInterface { public static function getSubscribedEvents() { return [ …
Ruben Lech
  • 125
  • 12
0
votes
1 answer

Escaping closure setting views in DispatchQueue.main.async Swift 3

I'm dealing with some asynchronous functions and trying to update views. In short I have function 1 with asynchronous function that will return a string to be passed to function 2. I am updating views in both functions, on main thread. It all works…
Jim H.
  • 285
  • 1
  • 2
  • 15
0
votes
1 answer

Gearman -- Unbalanced in dispatching

I have 2 gearman admins with diffrent IP address, and I have 40 workers in two clients, each client have 20 workers on it. Here is the problem, I check the status of 2 admins for every 10 minutes, and they have the same number of jobs at…
ivila
  • 25
  • 6
0
votes
1 answer

python: create 2 com objects

I need to connect remotely to two instruments using win32com, but I get an error when the second object is created. the code looks like this: scope1 = win32com.client.Dispatch("LeCroy.ActiveDSOCtrl.1") #creates first instance of the ActiveDSO…
0
votes
1 answer

React-native Dispatch action to two tabs at once

I want to re-render two tabs by setParams, it works if i dispatch to one tab, but dispatch to two tabs like code bellow doesn't work const setParamsAction1 = NavigationActions.setParams({ params: { foo: 'bar' } }, key: 'a' }); const setParamsAction2…
TomSawyer
  • 3,711
  • 6
  • 44
  • 79
0
votes
1 answer

Cannot figure out how to manage MBProgressHUD and dispatch

I'm implementing an iOS app and trying to do the following while uploading a photo to a server: Start upload process with Alamofire Display a progress indicator with MBProgressHUD When the upload is done, hide the progress indicator Depending on…
radar
  • 500
  • 1
  • 6
  • 24
0
votes
1 answer

How to set up DispatchGroup in asynchronous iteration?

I´m trying to set up an iteration for downloading images. The whole process works, but taking a look in the console´s output, something seems to be wrong. func download() { let logos = [Logos]() let group = DispatchGroup() …
Josch Hazard
  • 323
  • 3
  • 20
0
votes
0 answers

Java dynamic dispatch method based on concrete object type

Is it possible in Java to do a kind of dynamically dispatch a method based on the runtime type of an object? Defining the following hierarchy: public abstract class AbstractError {...} public class GenericError extends AbstractError {...} public…
Gerard Bosch
  • 648
  • 1
  • 7
  • 18
0
votes
1 answer

StreamDelegate stops to receive events after a amount of readings in swift

I have an iOS chat application that receives messages over a socket connection. When user open the app after a long time and there are more than 50 unread messages, the server send over socket a message telling the number of unread messages, at this…
Charles Lima
  • 381
  • 4
  • 9
0
votes
3 answers

Dispatch Redux action in React

I'm trying to fetch test API using FetchAPI and Redux. The problem is with dispatch redux action. Here's my code: ProductList.js import React, { Component } from 'react'; import { bindActionCreators } from 'redux'; import { connect } from…
mskuratowski
  • 4,014
  • 15
  • 58
  • 109
0
votes
1 answer

How implement optimized multiple timer in swift?

I just wonder what is the best implementation of memory optimized versatile multi Timers in swift. The timers which are concurrent and have weak reference with Dispatch? I've tried to implement two timers in one view controller and I got an…
Emran
  • 79
  • 1
  • 11
0
votes
0 answers

How to dispatch jsp from memory java

I am trying to find a way to dispatch jsp/html from memory. Now I am using the getRequestDispatcher method and passing it the path of my local project. What I am doing now: request.getRequestDispatcher("/test/update.jsp").forward(request, …
Gal Kogman
  • 69
  • 2
  • 7
0
votes
0 answers

React-native Redux action not dispatching

I am in the process of migrating an app from React to React Native and am running into an issue with Redux not dispatching the action to Reducer. My root component looks like this: import React, { Component, PropTypes } from 'react' import { connect…
Dean Vaessen
  • 59
  • 1
  • 7
0
votes
1 answer

Grand Center Dispatch For Loop

for i in 0...attString.length-1 { attString.enumerateAttribute(NSBackgroundColorAttributeName, in: NSMakeRange(i,1), options: NSAttributedString.EnumerationOptions(rawValue: 0)) { (value, range, stop) -> Void in if let exValue = value…
Elita
  • 77
  • 10
0
votes
1 answer

crash in simulator but iphone when I use dispatch_aplly

When I user dispatch_apply to add some data to nscountset,I get a crash in simulator but iphone. And get a message "-[__NSArrayI isEqual:]: message sent to deallocated instance 0x60000024c5a0" ,I can not find how it happen. CGSize thumbSize =…
H.WZ
  • 457
  • 1
  • 4
  • 9