This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .configure_aws_template.sh | |
rand=$(xxd -l 4 -c 4 -p < /dev/random); | |
sed -i 's/XXXX/'${rand}'/g' template.yaml; | |
# ----------------------------------------------------- # | |
# template.yaml | |
CARBN_ENV_DBSchemaLambdaFunctionTriggerXXXX: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .circleci/.configure_aws_template.sh | |
payment_processing_server_ip=$([ $1 = "prod" ] && echo "54.90.113.155" || echo "18.170.1.160"); | |
sed -i 's/CARBN_PAYMENT_PROCESSING_SERVER_IP_ADDRESS/'${payment_processing_server_ip}'/g' template.yaml; | |
# ----------------------------------------------------- # | |
# template.yaml | |
CARBN_ENV_PaymentProcessingAPI: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
import FaultOrderingTests | |
@MainActor | |
func testExample() throws { | |
let app = XCUIApplication() | |
let test = FaultOrderingTest { app in | |
app.launch() | |
} | |
test.testApp(testCase: self, app: app) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actor DependencyResolver { | |
private var completedSteps: [LaunchStep.Type] = [] | |
private var pendingSteps: [LaunchStep] = [] | |
init(steps: [LaunchStep]) { | |
self.pendingSteps = steps | |
} | |
func getAndClaimNextAvailableStep() -> LaunchStep? { | |
// Find all steps whose dependencies are satisfied |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func runWorker(id: Int, resolver: DependencyResolver) async { | |
while await !resolver.allStepsComplete() { | |
if let step = await resolver.getAndClaimNextAvailableStep() { | |
executeStep(step) | |
await resolver.markStepComplete(type(of: step)) | |
} else { | |
try? await Task.sleep(for: .milliseconds(5)) | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func executeMainThreadStepsInParallel() async { | |
let mainSteps: [LaunchStep] = [ | |
AppConfigStep(), | |
LoggingConfigurationStep(), | |
NetworkMonitoringStep(), | |
SecureStorageStep(), | |
UserDefaultsStep(), | |
AudioSessionStep(), | |
CrashReportingStep(), | |
DatabaseSchemaStep(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol LaunchStep { | |
var name: String { get } | |
var dependencies: [LaunchStep.Type] { get } | |
var priority: LaunchPriority { get } | |
func execute() // Synchronous, blocking execution | |
} | |
// ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func executeMainThreadStepsInParallel() async { | |
let mainSteps: [LaunchStep] = [ | |
AppConfigStep(), | |
LoggingConfigurationStep(), | |
SecureStorageStep(), | |
UserDefaultsStep(), | |
CrashReportingStep(), | |
DatabaseSchemaStep(), | |
FeatureFlagsStep(), | |
PersistenceStep(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func application( | |
_ application: UIApplication, | |
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? | |
) -> Bool { | |
let group = DispatchGroup() | |
group.enter() | |
Task.detached(priority: .high) { | |
await LaunchOrchestrator.shared.executeCriticalLaunchPath() | |
group.leave() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@main | |
final class AppDelegate: UIResponder, UIApplicationDelegate { | |
func application( | |
_ application: UIApplication, | |
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? | |
) -> Bool { | |
LaunchOrchestrator.shared.executeCriticalLaunchPath() | |
DispatchQueue.global(qos: .utility).async { |
NewerOlder