Skip to content

Conversation

THardy98
Copy link
Contributor

What was changed

C bridge code for .NET env config

  1. Part of [Feature Request] Environment Configuration sdk-dotnet#490

  2. How was this tested:
    Integration tests lang-side

  3. Any docs updates needed?
    No

@THardy98 THardy98 force-pushed the expose_envconfig_c_bridge branch from 240b196 to 9a9cbe7 Compare August 25, 2025 18:46
@THardy98 THardy98 marked this pull request as ready for review August 25, 2025 20:12
@THardy98 THardy98 requested a review from a team as a code owner August 25, 2025 20:12
Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestions. Also, can we submit use of this (which I am guessing is at temporalio/sdk-dotnet#509) for PR review before merging this just to make sure we're good there from a review POV? We can basically merge both at once when both approved (obviously this first and submodule update over there).


/// Load a single client profile from given sources with env overrides
#[unsafe(no_mangle)]
pub extern "C" fn temporal_core_client_config_profile_load(
Copy link
Member

@cretz cretz Aug 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you be a bit more specific in docs on what format the callback receives on success and fail? They are just byte arrays, so we can be a bit clearer. Can do this in the callback docs instead of here if easier.


/// Load a single client profile from given sources with env overrides
#[unsafe(no_mangle)]
pub extern "C" fn temporal_core_client_config_profile_load(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are several parameters here. I think it'd be ok if we accepted a ClientConfigProfileLoadOptions struct with all of this in it instead. Similarly, would have a ClientConfigLoadOptions for the other exposed function.


/// Load all client profiles from given sources
#[unsafe(no_mangle)]
pub extern "C" fn temporal_core_client_config_load(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was reviewing .NET and noticed - this doesn't need to be async w/ a callback. Can just return the result or failure. Can see calls like temporal_core_runtime_new or temporal_core_worker_new to see how they return success or fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants