Closed binchoo closed 2 years ago
manual // AwsEventWrapperManual
.whenEvent(SQSEvent.class) // MappingEntry<SQSEvent>
.wrapIn(SQSEventWrapper.class) // WrapperSpec<SQSEventWrapper>
.and() // AwsEventWrapperManual
.whenEvent(S3Event.class).satisfies(new IsJsonObject()) // MappingEntry<S3Event>
.wrapIn(S3JsonObjectReader.class).argTypes(AmazonS3.class) // WrapperSpec<S3JsonObjectReader>
.and() // AwsEventWrapperManual
.whenEvent(S3Event.class)
.wrapIn(S3ByteStreamReader.class).argTypes(AmazonS3.class)
;
Pros
Cons
.satisfies(condition)
always implies .satisfies(else-condition)
is required.e = the event type given to a lambda
E = the size of the set of events
N = the number of MappingEntry<e> in MappingEntries = O(C)
avgload(e) = the average load to traverse MappingEntry<e> (Predicate logics decide this factor.)
MappingEntry::Condition
that can lead users to bad decisions.
Customizing Event Wrapper Mappings
DSL definitions
Here defines the basic stucture of DSL that configures event wrapper mappings in YAML format. However, this is only to draw the conceptual structure in human-readable manner. The actual DSL is implemented by java objects.
DSL
WrappingManual
MappingEntries
MappingEntry
WrapperSpec
An example