fsprojects-archive / zzarchive-FSharp.Desktop.UI

F# MVC framework for WPF.
http://fsprojects.github.io/FSharp.Desktop.UI/
Other
81 stars 21 forks source link

External async updates to the model? #21

Closed FrankBro closed 8 years ago

FrankBro commented 8 years ago

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.

FrankBro commented 8 years ago

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

dmitry-a-morozov commented 8 years ago

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.

FrankBro commented 8 years ago

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