I'm converting some Combine publishers to async using .values and trying to understand what happens when:
A Publisher completes before emitting a value.
Here is some example code:
let response = client.fetch(query: query)
.tryMap {
/* map the data, or throw a mapping error if it doesn't map. */
}
return Model()
}
.eraseToAnyPublisher()
.values
for try await result in response {
return result
}
throw AsyncCombineError.finishedWithoutValue // my custom error
What happens with .values if the publisher completes without emitting any values? It returns a type of AsyncThrowingSequence<Self>
Will it throw? return? hang? or is this state impossible to happen?
Thanks and please enlighten me if I am misunderstanding structured concurrency. This is new to me!
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello,
I've installed XCode 15b2, I've copied the runtime into the appropriate folder. I can play around with the canvas to build a Vision Pro app, but when I run, it builds and cannot launch the simulator.
Could not launch Simulator.app.
Domain: DVTiPhoneSimulatorErrorDomain
Code: 1
User Info: {
DVTErrorCreationDateKey = "2023-06-22 03:15:54 +0000";
IDERunOperationFailingWorker = "_IDEInstalliPhoneSimulatorWorker";
}
The operation couldn’t be completed. (OSStatus error -10825.)
Domain: NSOSStatusErrorDomain
Code: -10825
Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : {
"device_model" = "RealityDevice14,1";
"device_osBuild" = "1.0 (21N5165g)";
"device_platform" = "com.apple.platform.xrsimulator";
"dvt_coredevice_version" = "325.3";
"dvt_mobiledevice_version" = "1643.0.15.100.1";
"launchSession_schemeCommand" = Run;
"launchSession_state" = 1;
"launchSession_targetArch" = arm64;
"operation_duration_ms" = 270;
"operation_errorCode" = 1;
"operation_errorDomain" = DVTiPhoneSimulatorErrorDomain;
"operation_errorWorker" = "_IDEInstalliPhoneSimulatorWorker";
"operation_name" = IDERunOperationWorkerGroup;
"param_consoleMode" = 0;
"param_debugger_attachToExtensions" = 0;
"param_debugger_attachToXPC" = 1;
"param_debugger_type" = 3;
"param_destination_isProxy" = 0;
"param_destination_platform" = "com.apple.platform.xrsimulator";
"param_diag_MainThreadChecker_stopOnIssue" = 0;
"param_diag_MallocStackLogging_enableDuringAttach" = 0;
"param_diag_MallocStackLogging_enableForXPC" = 1;
"param_diag_allowLocationSimulation" = 1;
"param_diag_checker_tpc_enable" = 1;
"param_diag_gpu_frameCapture_enable" = 0;
"param_diag_gpu_shaderValidation_enable" = 0;
"param_diag_gpu_validation_enable" = 0;
"param_diag_memoryGraphOnResourceException" = 0;
"param_diag_queueDebugging_enable" = 1;
"param_diag_runtimeProfile_generate" = 0;
"param_diag_sanitizer_asan_enable" = 0;
"param_diag_sanitizer_tsan_enable" = 0;
"param_diag_sanitizer_tsan_stopOnIssue" = 0;
"param_diag_sanitizer_ubsan_stopOnIssue" = 0;
"param_diag_showNonLocalizedStrings" = 0;
"param_diag_viewDebugging_enabled" = 1;
"param_diag_viewDebugging_insertDylibOnLaunch" = 1;
"param_install_style" = 0;
"param_launcher_UID" = 2;
"param_launcher_allowDeviceSensorReplayData" = 0;
"param_launcher_kind" = 0;
"param_launcher_style" = 0;
"param_launcher_substyle" = 0;
"param_runnable_appExtensionHostRunMode" = 0;
"param_runnable_productType" = "com.apple.product-type.application";
"param_testing_launchedForTesting" = 0;
"param_testing_suppressSimulatorApp" = 0;
"param_testing_usingCLI" = 0;
"sdk_canonicalName" = "iphonesimulator17.0";
"sdk_osVersion" = "17.0";
"sdk_variant" = iphonesimulator;
}
System Information
macOS Version 13.3.1 (a) (Build 22E772610a)
Xcode 15.0 (22181.22) (Build 15A5161b)
Timestamp: 2023-06-22T13:15:54+10:00
xcrun simctl list
-- visionOS 1.0 --
Apple Vision Pro (F6BB2E07-3C70-4ECC-A717-1E4D7A7AA783) (Booted)