Refactoring Refuge with Modules

Our previous work in the Refuge composition has kept a lot of functionality expanded in our chapter files, which is getting a bit unwieldy. Let’s see if we can move the Refuge-specific types and functions we’ve defined into their own modules to simplify the composition and make our Refuge-specific patterns easier to reuse.

A Refuge-Specific Load Balancer

We’ll start with the loadbalancer function we defined in Chapter 6, Understanding Ludwig. Our first step is to copy the definition of loadbalancer out to its own file. Remember that the file name determines the module name, so we need to consider what we want our module to be called. Given that these are Refuge-specific modules, it makes sense to stick everything ...

Get Scalable Cloud Ops with Fugue now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.