Jul 12, 2016
Manage Mutable State Actors Mailboxprocessor
Today I would like to share a technique that I use to maintain mutable shared state in my F# applications. This technique uses the MailboxProcesser, a simplified implementation of the actor model built into F#. Here’s the issue: I have a dataframe shared accross my whole application.
The dataframe is constructed at bootup of the server which makes the application not scalable as to reconstruct the dataframe, a reboot is needed.
The solution would be to provide a way to mutate the dataframe any time I need to.
But mutable state involves concurrency issues and that’s where the MailboxProcesser comes to the rescue.