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

How to configure kamailio server with load balancing and asterisk?

I want to configure Kamailio server so that traffic will be forwarded to other four asterisk servers equally. It is working fine with a single asterisk box but I am unable to forward a call to another asterisk box. Here is the kamailio.cfg that I am…
0cool
  • 90
  • 1
  • 1
  • 13
4
votes
1 answer

WPF: Modifying CollectionView from Dispatcher still throws errors

I have the following bit of code that modifies an observable collection of 'screens' whenever a user leaves. void OnUserLeft(int roomId, int userId, string username) { client.ClientDispatcher.Invoke( (Action)((id) => …
Dusda
  • 3,347
  • 5
  • 37
  • 58
4
votes
1 answer

WPF Dispatcher timer tick freezes my application

I've got a little problem using WPF Dispatcher Timer. On each timer tick my application freezes for a moment (until timer tick method finishes). This is my code: private DispatcherTimer _Timer = new DispatcherTimer(); _Timer.Tick += new…
Nebojsa Veron
  • 1,545
  • 3
  • 19
  • 36
4
votes
1 answer

Double await when invoke async lambda via Dispatcher

private async Task LoadForm(WebControlAsync browser, Uri url) { ... } var forms = await await _dispatcher.InvokeAsync(async () => await LoadForm(browser, form.Url)); I don't understand why I have to use two await's here to get T in forms? So it…
Aleksey Shubin
  • 1,960
  • 2
  • 20
  • 39
4
votes
5 answers

Deadlock when thread uses dispatcher and the main thread is waiting for thread to finish

Can someone please explain why this creates a deadlock, and how to solve it? txtLog.AppendText("We are starting the thread" + Environment.NewLine); var th = new Thread(() => { …
seguso
  • 2,024
  • 2
  • 18
  • 20
4
votes
0 answers

WebApplicationInitializer not calling the correct "DispatcherServlet" returning always 404

I have swtich from working spring MVC application configured with xml's to java configuration with spring boot and I am facing the following behavior. No matter what jsp page I am calling I am always getting the 404 error. The controller is being…
Tito
  • 2,234
  • 6
  • 31
  • 65
4
votes
1 answer

In a Task, why does IProgress executes correctly in the UI thread but not an Action?

On the following piece of code : Task UpdateMedias(Expression> property, Func func) { var medias = GetSelectedMedias().ToList(); IProgress progress = new Progress(d =>…
aybe
  • 15,516
  • 9
  • 57
  • 105
4
votes
4 answers

Rx reactive extensions Observeondispatcher unit test error: The current thread has no Dispatcher associated with it

I want to unit test a view model which contains a registration like: public SampleViewModel(IUnityContainer container) { ... Observable.FromEventPattern(gridViewModel, "PropertyChanged") …
Pinte Dani
  • 1,989
  • 3
  • 28
  • 35
4
votes
1 answer

Are Akka .conf dispatcher configuration working?

I'm using Akka 2.2-RC1 and I'm not able to get Akka to load dispatcher configuration from application.conf: my-dispatcher { type = PinnedDispatcher executor = "thread-pool-executor" } akka.actor.deployment { /test { dispatcher =…
Seigert
  • 311
  • 3
  • 11
4
votes
1 answer

An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll

I'm working on a small application in C# / WPF that is fed by data from the serial port. It also reads a text file containing some constants in order to calculate something. An event handler is made to handle the incoming data when it…
Morty
  • 43
  • 1
  • 1
  • 3
4
votes
1 answer

synchronize wpf dispatcher.invoke from multiple background threads

Do I need to synchronize calls to the Dispatcher.Invoke if accessing from multiple background threads? I know the Dispatcher.BeginInvoke automatically synchronizes calls for silverlight app…
Ishpal
  • 103
  • 1
  • 8
4
votes
1 answer

How do I use Dispatcher.BeginInvoke properly?

I have searched almost everywhere on the internet, and I have googled so many times and found so many results, but I still can't find the solution to my problem. I am busy converting an old WinForms application to a new WPF application but I am…
GANDA1F
  • 307
  • 1
  • 4
  • 13
4
votes
2 answers

Using Task vs Dispatcher for ui thread actions

I know the technique about UI thread updating from another thread. So I have these two methods/techniques, which one should I use? Using Task: var uiTask = Task.Factory.StartNew(() => { // change something on ui thread var action =…
4
votes
5 answers

as3 - dispatchEvent from a parent swf to a child swf

I have one main "parent" swf that loads several other swfs. If something happens in the main swf I need to tell one of the child swfs about it. This seems to work well the other way around. Any of the children can simply dispatchEvent(), and I can…
sol
  • 601
  • 2
  • 10
  • 16
4
votes
1 answer

Use DispatcherTimer with Windows Service

Why my DispatcherTimer don't work with Windows Service . The purpose behind that i want use DispatcherTimer for check a windows service License public OIMService() { InitializeComponent(); _dispatcherTimer = new…
Tarek Saied
  • 6,482
  • 20
  • 67
  • 111