nats-io / nats.rs

Rust client for NATS, the cloud native messaging system.
Apache License 2.0
1.06k stars 168 forks source link

jetstream examples should be merged #1319

Open andrewgazelka opened 1 month ago

andrewgazelka commented 1 month ago

Observed behavior

https://github.com/nats-io/nats.rs/blob/main/async-nats/examples/jetstream_push.rs https://github.com/nats-io/nats.rs/blob/main/async-nats/examples/jetstream_pull.rs

are pretty much identical (from what I can tell)

Expected behavior

do not have duplicate examples (you should just have one)

Server and client version

not relevant

Host environment

No response

Steps to reproduce

No response

andrewgazelka commented 1 month ago

probably not a defect. However, I did not know what to put this as.

caspervonb commented 1 month ago

Key difference is that they create different configs, e.g pull::Config vs push::Config, these give different implementations of the internals.

Pull example can probably be expanded to showcase fetch etc tho.

andrewgazelka commented 1 month ago

Key difference is that they create different configs, e.g pull::Config vs push::Config, these give different implementations of the internals.

Pull example can probably be expanded to showcase fetch etc tho.

ah I see... yea was hard for me to tell that was the difference but perhaps I did not look hard enough. wonder if this can be emphasized somehow.

Jarema commented 1 month ago

I agree with both of you:

  1. We should add some comments.
  2. We should use pull-specific method too.