Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the Transport to have a different kind of information for the target ChoreographyLocation #15

Merged
merged 11 commits into from
Sep 20, 2023

Conversation

ihaveint
Copy link
Collaborator

@ihaveint ihaveint commented Sep 20, 2023

This allows the user to specify different types of information for the target location when building the transport.

if users want to make a HttpTransport, they currently do this:

use crate::transport::TransportConfig;
use crate::transport_config;

// for http transport:
let config = transport_config!(
                Alice => ("0.0.0.0".to_string(), 9021),
                Bob: ("localhost".to_string(), 9020)
                Carol: ("localhost".to_string(), 9022)
            );
let alice_transport = HttpTransport::new(&config);

But with this pull request, we support custom Transports where the information type for Alice is different then the one for Bob and Carol. Something like this:

// for a custom transport:
let config = transport_config!(
                Alice => value_of_type_a,
                Bob: value_of_type_b,
                Carol: another_value_of_type_b
            );

let alice_transport = CustomTransport::new(&config);

@ihaveint ihaveint force-pushed the target-specific-info branch from 2798133 to 07f5021 Compare September 20, 2023 00:06
@ihaveint ihaveint merged commit 5bf932a into transport-location-set Sep 20, 2023
@shumbo shumbo deleted the target-specific-info branch October 6, 2023 21:25
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.

1 participant