Skip to content

Support custom slot suppliers #90

@FranzBusch

Description

@FranzBusch

The SlotSupplier type currently supports .fixedSize and .resourceBased variants. The bridge FFI layer also supports a Custom one with callback-based slot suppliers (TemporalCoreCustomSlotSupplierCallbacks), allowing users to implement their own slot allocation logic.

A custom slot supplier requires implementing these callbacks via a Swift protocol:

  • reserveSlot — async reservation of a slot (called when a task needs a slot)
  • tryReserveSlot — non-blocking attempt to reserve a slot
  • markSlotUsed — called after a reserved slot begins processing a task
  • releaseSlot — called when a task completes and its slot is freed
  • availableSlots — returns the current number of available slots

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/enhancementImprovements to existing feature.size/SSmall task. (A couple of hours of work.)status/needs-designNeeds further discussion and a concrete proposal.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions