Package 

Object StreamEventAggregationPolicy.Companion

    • Method Detail

      • from

         final <T extends Any> StreamEventAggregationPolicy<T> from(Function1<String, String> typeExtractor, Function1<String, Result<T>> deserializer, Integer aggregationThreshold, Long maxWindowMs, Integer dispatchQueueCapacity)

        Creates a validated policy from the given parameters.

        val policy = StreamEventAggregationPolicy.from(
            typeExtractor = { raw -> eventParser.peekType(raw) },
            deserializer = { raw -> eventParser.deserialize(raw) },
            aggregationThreshold = 100,
            maxWindowMs = 300,
        )
        Parameters:
        typeExtractor - Extracts the event type from a raw message.
        deserializer - Deserializes a raw message into T.
        aggregationThreshold - Events before aggregated delivery triggers.
        maxWindowMs - Maximum collection window in milliseconds.
        dispatchQueueCapacity - Dispatch queue capacity.