apple / apple/swift-temporal-sdk

Support custom slot suppliers

Open
#90 0 comments 0 reactions 0 assignees View on GitHub
kind/enhancement size/S status/needs-design
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.