Overview
Implement a complete Future backend as the primary API for staRburst. The direct API (starburst_map) will be refactored as a convenience wrapper around the Future backend.
Architecture Decision
Future-first approach: All features and functionality will be built around the Future backend. This provides:
- Clean integration with the Future ecosystem (furrr, future.apply, targets)
- Consistent async/parallel execution model
- Easier maintenance (single execution path)
- Better composability with existing R parallel tools
Current Status
- ✅ Direct API (
starburst_map, starburst_cluster) working and validated
- ✅ AWS infrastructure fully functional (Fargate, Docker, S3, IAM)
- ⏳ Basic
StarburstFuture class exists in R/future-starburst.R
- ⏳ Needs complete implementation
Implementation Plan
Phase 1: Core Future Backend
Phase 2: Refactor Direct API as Wrapper
Phase 3: Testing & Documentation
Benefits
- Ecosystem compatibility: Drop-in replacement for
future::plan(multisession)
- Composability: Works with existing furrr code:
future_map(), future_pmap(), etc.
- Targets integration: Compatible with targets, clustermq, and other Future-aware packages
- Single execution path: Easier to maintain and extend
- Clean architecture: Future provides the abstraction, staRburst provides the AWS backend
API Examples
Future API (Primary)
library(furrr)
plan(future_starburst, workers = 50, cpu = 4, memory = "8GB")
# Just works with furrr
results <- future_map(1:1000, expensive_function)
Direct API (Convenience wrapper)
# Still works, but internally uses Future backend
results <- starburst_map(1:1000, expensive_function, workers = 50)
Estimated Effort
Medium-Large - ~1000 lines of code, 3-4 weeks
- Week 1-2: Core Future backend implementation
- Week 3: Refactor direct API as wrapper
- Week 4: Testing, documentation, refinement
References
Overview
Implement a complete Future backend as the primary API for staRburst. The direct API (
starburst_map) will be refactored as a convenience wrapper around the Future backend.Architecture Decision
Future-first approach: All features and functionality will be built around the Future backend. This provides:
Current Status
starburst_map,starburst_cluster) working and validatedStarburstFutureclass exists inR/future-starburst.RImplementation Plan
Phase 1: Core Future Backend
run()method for Future executionresolved()method for checking completionresult()method for retrieving resultsplan(future_starburst)Phase 2: Refactor Direct API as Wrapper
starburst_map()to use Future backend internallystarburst_cluster()to create Future planPhase 3: Testing & Documentation
Benefits
future::plan(multisession)future_map(),future_pmap(), etc.API Examples
Future API (Primary)
Direct API (Convenience wrapper)
Estimated Effort
Medium-Large - ~1000 lines of code, 3-4 weeks
References
R/future-starburst.R- Existing scaffoldingR/starburst-map.R- Current direct API to refactor