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
3
votes
1 answer

Combined vectorized functions in Numba

I'm using Numba (version 0.37.0) to optimize code for GPU. I would like to use combined vectorized functions (using @vectorize decorator of Numba). Imports & Data: import numpy as np from math import sqrt from numba import vectorize,…
jetxeberria
  • 187
  • 1
  • 8
3
votes
2 answers

AS3 Dispatch Custom Event from class to class

I want to dispatch a custom event from the Country() sto the MenuButton(); CountryEvent package { import flash.events.Event; public class CountryEvent extends Event { public static const COUNTRY_HOVERED:String = "onCountryOver"; private…
chchrist
  • 18,854
  • 11
  • 48
  • 82
3
votes
1 answer

Wait two sequence actions before do something in ngrx effect angular

I want to: create a book, then load list of books, then navigate to book detail page Assume that I have 2 effects: load list book and create book. loadListBook effect work correctly (as before) My create effect is written correct? create$:…
dlam
  • 145
  • 2
  • 11
3
votes
1 answer

When Using Redux Saga with React Get This Error .. Uncaught TypeError: getPosts is not a function

Trying to learn how to use Redux Sagas with React. Put together a simple example but it is not working for me. My code in my App.js file: const sagaMiddleware = createSagaMiddleWare(); const store = createStore( reducers, …
sayayin
  • 971
  • 5
  • 23
  • 36
3
votes
1 answer

Does marking a Swift class final also make all contained vars, lets and functions gain Static Dispatch benefits automatically?

I am trying to squeeze every last bit of performance out of my app. I try to use Structs over classes wherever possible (no state sharing, direct dispatch by default, etc etc). But my view controllers and UIView objects are obviously still…
FranticRock
  • 3,233
  • 1
  • 31
  • 56
3
votes
0 answers

DispatchWorkItem do not cancel task at once

I have a nasty search problem. There is an array of structures with 30000 objects and a textView, when entering letters, I delete spaces and set the text in searchText, searchText has WillSet and DidSet, in WillSet I cancel all search tasks with old…
Vasya2014
  • 203
  • 1
  • 5
  • 25
3
votes
2 answers

React-Native/Redux-Saga: how to wait for dispatch to finish

Hi Stack Overflow community! I'm looking for a good practice and implementation to wait for a dispatched action in a component. I know React-Native and Redux-Saga just say: don't wait for it, let the store be updated, and through selectors, your…
Thomas Stubbe
  • 1,945
  • 5
  • 26
  • 40
3
votes
1 answer

Is it possible to dispatch S3 methods based on the class of an argument specified by its position only?

Imagine we have the following S3 generic that we want to dispatch using the class of the first argument: genfun <- function(x, ...) UseMethod("genfun", x) Let's now consider a numeric method for this generic: genfun.numeric <- function(x, y) { …
Marc Choisy
  • 141
  • 4
3
votes
1 answer

Constraining multis and its use for selecting them

Constraints are apparently not used to select one in a multi multi sub cuenta( Str $str ) { say $str }; multi sub cuenta( $file where .IO.e ) { say $file.IO.slurp }; cuenta( $*PROGRAM-NAME ); # Outputs the file name That means it's using the first…
jjmerelo
  • 22,578
  • 8
  • 40
  • 86
3
votes
1 answer

R: S3 Method dispatch depending on arguments

I have a generic function foo that I want to call three different ways depending on the arguments given to it. foo <- function(...) UseMethod("foo") #default foo.default <- function(x, y, ...) { #does some magic print("this is the default…
Justin Landis
  • 1,981
  • 7
  • 9
3
votes
3 answers

Nested async calls in Swift

I'm kind of new to programming in general, so I have this maybe simple question. Actually, writing helps me to identify the problem faster. Anyway, I have an app with multiple asynchronous calls, they are nested like…
Max Kraev
  • 740
  • 12
  • 31
3
votes
1 answer

dispatch.yaml in Google App Engine has increase the response time

Based on 100 requests. Region: southamerica-east1 When executing a GET at xxx.appspot.com/api/v1/ping the average response time is +/- 50 ms. Example: Load time: 83 ms When activating dispach.yaml (gcloud app deploy dispatch.yaml) and executing…
3
votes
1 answer

React Native, Fetch, and Dispatch: How do I access responseData within mapDispatchToProps()?

I'm fetching JSON Data within componentWillMount() from my "Scanner" component like so: async componentWillMount() { const url = 'https://foo.com/products/product1.json'; fetch(url) .then((response) => response.json()) .then((responseData)…
mobiman
  • 619
  • 1
  • 11
  • 26
3
votes
5 answers

React.js - In plain english what is mapDispatchToProps?

I've been learning React/Redux for a few days. In plain and basic english, what is mapDispatchToProps? I have this function that I don't understand. function mapDispatchToProps(dispatch) { return bindActionCreators({ selectBook: selectBook},…
Lizz Parody
  • 1,705
  • 11
  • 29
  • 48
3
votes
2 answers

Fastest implementation of simple, virtual, observer-sort of, pattern in c++?

I'm working my arse off trying to implement an alternative for vtables using enums and a ton of macro magic that's really starting to mess with my brain. I'm starting to think i'm not walking the right path since the code is getting uglier and…