lundi 22 novembre 2021

Elixir - Changing default behavior of actors

I am currently looking into the behavioral reflection possibilities of Elixir, a language to which I'm pretty new. Specifically, I am searching for a way to change the default behavior of actors within Elixir, or install hooks within this behavior. As a classic example, let's say I want to log messages when they are send from one actor, arrive in the other actor and are actually processed. Could I change/override/hook into the default behavior of these hypothetical 'send', 'arrive' and 'process' methods in orde to add this functionality as 'default behavior'? How would this be done?

The logging example above is just an example. I am looking to use the approach used to implement this example in a broader context (eg. change default mailbox behavior).





Aucun commentaire:

Enregistrer un commentaire