We have a behavior for chunking strategies, which is a great way to document a pluggable interface, but we're not using it to its fullest because the :strategy option takes a function capture instead of a module that implements the behavior.
If we ever needed to add another function to the behavior, we'd also have to change the way the caller specifies the strategy. If we use the behavior instead and modify it to add the new function, the change would just work as long as the client code's strategy fits the updated behavior definition, and the compiler would complain otherwise.
Background
We have a behavior for chunking strategies, which is a great way to document a pluggable interface, but we're not using it to its fullest because the
:strategy
option takes a function capture instead of a module that implements the behavior.If we ever needed to add another function to the behavior, we'd also have to change the way the caller specifies the strategy. If we use the behavior instead and modify it to add the new function, the change would just work as long as the client code's strategy fits the updated behavior definition, and the compiler would complain otherwise.