Questions tagged [dispatch]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
184 views

Message Dispatching: If, Visitor, or something else

I often write code to implement the dispatching and handling of "messages." My requirements are usually: I should be able to add new types of messages AND/OR new types of handlers without ...
Patrick Wright's user avatar
0 votes
0 answers
277 views

value-based function dispatch

Problem to solve I have a method parse_doc that should dynamically determine a parsing function to parse document_id based on the value of the document_id string: # list of files that may have ...
anon01's user avatar
  • 117
0 votes
1 answer
349 views

Type selection from a dispatcher table

I am trying to use a dispatch table to select a data type to cast something as and cannot figure out the syntax for this. g_cast_table[] = { {'h', short int} or {'h', "short int"} } ...
M. Sharpe's user avatar
2 votes
0 answers
585 views

How to dispatch these functions in Objective C to not lock Main thread?

There's a large shared object (kind of OpenGL context) in my project. It is accessed from multiple threads. To ensure only one thread at the moments is using SHARED_OBJECT, mutex (kind of ...
olha's user avatar
  • 179
10 votes
5 answers
45k views

Dynamic dispatch from a string (Python)

Lets assume I have a string for a class name (or part of a class name), and I have implementation somewhere. All I want, is to be able to get an instance of a class with the name in the variable. For ...
Roman Susi's user avatar
  • 1,773
4 votes
5 answers
3k views

Dynamic dispatch overuse

I was going through old code and noticed one pattern that repeats itself all over the place - dynamic dispatch. While I don't see any problem with the implementation itself, I was wondering if there ...
Michael's user avatar
  • 183
3 votes
1 answer
1k views

A real-world use case for triple dispatch [closed]

A few times in my career I've encountered design problems that couldn't be elegantly solved with single dispatch and required double dispatch (which I implemented using visitors). However, I've never ...
Alexey's user avatar
  • 237
2 votes
2 answers
2k views

Is it possible to have Ad-Hoc polymorphism with runtime dispatch?

As I did understand, and as it's described here, ad-hoc polymorphism is limited to compile-time dispatch. That is, if we have a function that expects an argument that belongs to a typeclass, we must ...
Display Name's user avatar
2 votes
1 answer
5k views

Differences between Dynamic Dispatch and Dynamic Binding

I've been looking on Google for a clear diffrentiation with examples but couldn't find any. I'm trying to understand the differences between Dynamic Dispatch and Dynamic Binding in Object Oriented ...
Aviv Cohn's user avatar
  • 21.4k