Interface StickyBucketDocWriter

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface StickyBucketDocWriter
Seam through which evaluation hands newly assigned sticky bucket documents to the owning client for persistence. Whether the write blocks, is offloaded, or is fire-and-forget is the writer's choice — the evaluator stays synchronous and ignorant of I/O (the same seam as the Python SDK's EvaluationContext.save_sticky_bucket_doc).

When no writer is set on the evaluation context, the evaluator falls back to calling the configured StickyBucketService.saveAssignments(growthbook.sdk.java.model.StickyAssignmentsDocument) directly — the legacy single-user path, unchanged.

  • Field Details

    • DISCARDING

      static final StickyBucketDocWriter DISCARDING
      Drops every document. Set on the evaluation context when the user's stored assignments could not be read: that evaluation buckets normally, and persisting its result could replace the variation the store already holds for the user.
  • Method Details

    • write

      void write(StickyAssignmentsDocument doc)
      Persist a newly assigned document. Must not throw into evaluation.
      Parameters:
      doc - the document to persist