4 ms·
”Each Dagger module can only handle one data type. This is intentional. This forces users to make a separate handler for each type of data they want to handle.”
by Someone 8y ago
”Each Dagger module can only handle one data type. This is intentional. This forces users to make a separate handler for each type of data they want to handle.”
Don’t count on that. What you’ll get instead is a handler that defines a data type containing some enum field that changes what the rest of the data type means, or, worse, a data type named “script” containing a command and its arguments. The latter could give you a separate DSL for every module without any guarantee of consistency between them (just as Unix doesn’t agree about how to control verbosity, how to specify an output file, etc)
Also, think about how you’ll want to control modules. If you intend to shut them down, query their health, etc. using a handler, that doesn’t leave room for a handler that does the real work.
- adrianratnapala 8y ago> Also, think about how you’ll want to control modules. If you intend to shut them down, query their health, etc. One way around this (which might be useful even if there are multiple handlers per module) is to have explicit layers to the onion. That is, make the health checking stuff etc, belong to an outer layer that is different from where the application exposes it's API. The layers can still "grammar" (i.e. message protocol), but they are separate endpoints. I suspect (but do not know) that this lets the event protocol evolve more independently of the management framework. Which fits in with the OPs noble goal of keeping version 0 minimal. (In fact I think she wants to ignore what I called the "management framework" entirely).
- xena 8y ago> That is, make the health checking stuff etc, belong to an outer layer that is different from where the application exposes it's API. Yep. Ideally people would write handlers to handle both the health checking and the downtime response, but that largely boils down to implementation details.