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

Multiple endpoints service #791

Merged
merged 8 commits into from
Jan 11, 2023
Merged

Multiple endpoints service #791

merged 8 commits into from
Jan 11, 2023

Conversation

Jarema
Copy link
Member

@Jarema Jarema commented Jan 2, 2023

Signed-off-by: Tomasz Pietrek tomasz@nats.io

@Jarema Jarema force-pushed the jarema/multiple-endpoint-svc branch from ba99224 to 627c54b Compare January 3, 2023 13:08
@Jarema Jarema marked this pull request as ready for review January 3, 2023 13:08
stats: Arc<Mutex<Stats>>,
client: Client,
endpoint: String,
shutdown: Pin<Box<dyn Future<Output = Result<(), tokio::sync::broadcast::error::RecvError>>>>,
Copy link
Collaborator

@caspervonb caspervonb Jan 5, 2023

Choose a reason for hiding this comment

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

Why not take the broadcast receiver here? avoid the pin box indirection.

Suggested change
shutdown: Pin<Box<dyn Future<Output = Result<(), tokio::sync::broadcast::error::RecvError>>>>,
shutdown: Pin<Box<dyn Future<Output = Result<(), tokio::sync::broadcast::error::RecvError>>>>,

Copy link
Member Author

Choose a reason for hiding this comment

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

We would need to either call recv() and store the future in the same way, or call sync try_recv() which would not poll any future, hence when shutdown happens, iterators without messages would not be closed.

@Jarema Jarema force-pushed the jarema/multiple-endpoint-svc branch from 0b09dbe to 4609fe1 Compare January 5, 2023 11:28
Copy link
Collaborator

@caspervonb caspervonb left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Collaborator

@caspervonb caspervonb left a comment

Choose a reason for hiding this comment

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

Naming nits

async-nats/src/service/mod.rs Show resolved Hide resolved
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
@Jarema Jarema force-pushed the jarema/multiple-endpoint-svc branch from 6d86992 to 86aea2e Compare January 11, 2023 22:59
@Jarema Jarema merged commit da7bc22 into main Jan 11, 2023
@Jarema Jarema deleted the jarema/multiple-endpoint-svc branch January 11, 2023 23:20
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