3 ms·
I love this sort of approach for one-shot externalities but what about when your entire program is a conversation with external components? My current project c
by segfaltnh 3y ago
I love this sort of approach for one-shot externalities but what about when your entire program is a conversation with external components? My current project coordinates software repositories and services within AWS and I find myself using a lot of mocks in testing.
I can return a tree of lambdas but then I have to resolve them against something and that's just replacing mocks with lambdas, really. Not sure it's any better in practice.
- kmac_ 3y agoGreat question! I worked with two approaches: 1. Sagas - a centralised place to handle bussines flows 2. Event system Start with 1. and eventually (pun intended) move to 2. Both ways allow parallelized interactions with external systems, deferred decisions, etc. whatever the bussines will require.
- segfaltnh 3y agoSorry I wasn't clear, I'm talking about imperative code that coordinates multiple external actions. In a world where it's modeled as jobs in a distributed system, I agree that each job can be nicely functional (and I love this pattern).