apple / apple/swift-temporal-sdk
Support custom slot suppliers
- Dominant language
- Swift
- Stars
- 315
- Forks
- 31
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 4
Description
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
Contributor guide
Research direction
Start by tracing the existing SlotSupplier type and the bridge's TemporalCoreCustomSlotSupplierCallbacks, then compare the fixedSize and resourceBased variants. Review how the Swift API maps callback-based suppliers, and consider the work complete when all five listed callbacks are exposed through a custom Swift protocol and custom slot allocation can be used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100