Questions tagged [dispatcher]

In WPF and Silverlight, Dispatcher is an object that is used to execute work on a specific thread. In another meaning, dispatcher defines an object that receives requests from the client and sends them to any resource (such as a servlet, HTML file, or JSP file) on the server.

In and , Dispatcher is an object that is used to execute work on a specific .

In another meaning, a dispatcher object can forward a client's request to a resource or include the resource itself in the response back to the client. A resource can be another servlet, or an HTML file, or a JSP file, etc.

1296 questions
14
votes
2 answers

My async Task always blocks UI

In a WPF 4.5 application, I don't understand why the UI is blocked when I used await + a task : private async void Button_Click(object sender, RoutedEventArgs e) { // Task.Delay works great //await Task.Delay(5000); …
Nico
  • 575
  • 3
  • 8
  • 19
13
votes
3 answers

Weird problem with Rails app and Mongrel

I originally posted a question relating to this problem on serverfault.com: https://serverfault.com/questions/152587/apache-mod-proxy-to-another-server I have since realized that this is not an issue with my server setup, but my rails application. I…
trobrock
  • 46,549
  • 11
  • 40
  • 46
13
votes
2 answers

Dispatcher.CurrentDispatcher.BeginInvoke Not Invoking

I have a FileSystemWatcher and the events raised by this when a watched file changes are raised on a different thread from the UI thread. To avoid and cross-thread acess volation fun, I am attempting to use public void RaisePathChanged(object…
MoonKnight
  • 23,214
  • 40
  • 145
  • 277
12
votes
2 answers

Confused by the behavior of Dispatcher.BeginInvoke()

Could someone shed some light on an issue I'm having? I'm working on a wpf project. The scenario is as below: I need to pop up a window(model window) on main UI thread and then close it. These works are started from another UI thread (to deter user…
xiaoheixiaojie
  • 145
  • 1
  • 2
  • 8
12
votes
2 answers

Dispatcher and SynchronizationContext classes

Can somebody tell me when to use a Dispatcher and when to use the SynchronizationContext class? For a while now I have been using the Dispatcher to queue up tasks from a background thread, then I discovered the SynchronizationContext.
ash 2010
  • 329
  • 2
  • 9
12
votes
5 answers

Why BackgroundWorker always is busy?

I realized something strange in my background worker in my WPF application. What I'm trying to accomplish right now is to wait until the BW finishes to start another thread. Check the following code: if (bw.IsBusy) { bw.CancelAsync(); …
Darf Zon
  • 6,268
  • 20
  • 90
  • 149
11
votes
1 answer

Enable mod_headers in Apache in Windows

I am trying to configure Access-Control-Allow-Origin in Apache to allow certain domains. Below is my httpd configuration Header set Access-Control-Allow-Origin "*" But the above config is not doing anything.…
ezhil
  • 977
  • 6
  • 15
  • 36
11
votes
1 answer

Understanding the true behavior of the DispatcherPriority enum provided in WPF

There is documentation with definitions on what each enum does. But how am I able to demo/see this in practice? And how can I possibly know when to use which priority? Here's some code I have created in attempt to see how the priorty affects the…
William
  • 1,837
  • 2
  • 22
  • 36
11
votes
1 answer

Akka messaging mechanisms by example

I have a fair amount of Apache Camel (routing/mediation/orchestation engine; lightweight ESB) experience and am racking my brain trying to understand the difference between Akka: Dispatchers (Dispatcher, PinnedDispatcher,…
smeeb
  • 27,777
  • 57
  • 250
  • 447
11
votes
1 answer

Akka dispatcher inherritance

I'm working with Akka and we are still getting to get to know each other. My scenario is : I have chosen a non-default dispatcher for a supervisor (parent) actor who's role is to manage (supervise) and create child actors to do the work. Question :…
neurozen
  • 1,087
  • 13
  • 19
11
votes
2 answers

Dispatcher.BeginInvoke problems

I'm getting "An object reference is required for the non-static field, method, or property 'System.Windows.Threading.Dispatcher.BeginInvoke(System.Action)'" for this code. private void ResponseCompleted(IAsyncResult result) { …
cmaduro
  • 1,672
  • 3
  • 21
  • 40
11
votes
2 answers

Problems with Ampps

I have installed Impresspages on my local Ampps server. When I proceed to open it, I get error message: Error Fatal error: Call to undefined function Ip\ctype_digit() in /Applications/AMPPS/www/impresspage/Ip/Dispatcher.php on line 197 Here is line…
Gotita
  • 111
  • 1
  • 3
11
votes
2 answers

How to forward request from servlet to action of struts2?

I want to forward a request from Servlet to Action like this using RequestDispacher like this RequestDispatcher dispatcher=request.getRequestDispatcher("hello.action"); dispatcher.include(request, response); It's not working. How can I resolve this…
Sunil
  • 163
  • 2
  • 2
  • 7
10
votes
2 answers

Saving a FixedDocument to an XPS file causes memory leak

I have created a .NET Windows Service which performs certain actions and generates reports. These reports are XPS documents which I save in a certain directory. Being familiar with WPF, the way I have chosen to create the reports is to instantiate a…
Ross
  • 4,460
  • 2
  • 32
  • 59
10
votes
3 answers

How to get DispatcherQueue in WinUI 3 Desktop using Windows App SDK

In WPF all controls inherit DispatcherObject & its easy to get to the Dispatcher. How would I get the DispatcherQueue using WinUI 3 Windows App SDK and use it in a ViewModel? EDIT My implementation which expands on mm8's most appreciated…
tinmac
  • 2,357
  • 3
  • 25
  • 41