fsprojects-archive/zzarchive-FSharp.Desktop.UI

External async updates to the model?

FrankBro opened this issue · 3 comments

Sorry this is more a question than an issue.

I am trying to use this library for a project where I react also need to react to midi events which are coming from my controller. For this purpose, I have created an agent with MailboxProcessor from which I would like the model to update depending on different messages.

I saw in your wolfram example how to do async calls. My question is where would be the best place to introduce messages coming from the agent? I assume they should come in the controller but not sure how to plug this. Would using the Dispatcher member with an Async event handler which contains a recursive loop waiting on messages be okay?

Thank you.

Actually, by reading other issues I found https://github.com/dmitry-a-morozov/fsharp-wpf-mvc-series/wiki/External-Event-Sources, will try tonight.

Sorry for delayed response - I'm back from week long vacation.
Yes, try "external event source" concept and let me know if you have more questions.

I managed to get this working thanks to that sample. Thank you.