The relevant changes here are in src/api/history_stream.rs and examples/streams.rs.
Previously we were simply passing the ssb_id into create_history_stream(). This PR publically exports the CreateHistoryStreamIn type from kuska and renames it as CreateHistoryStream. create_history_stream() now expects a single argument in the form of CreateHistoryStream (this is similar to how SubsetQuery is passed to get_subset_stream()).
This change allows a library user to set additional options for the create_history_stream call, including the minimum sequence number and a limit on returned messages.
One question I have for @notplants: do you think CreateHistoryStream is consistent with the naming in the rest of golgi? I'm not entirely happy with it...perhaps HistoryStreamArgs is better?
Example usage:
lethistory_stream=sbot_client.create_history_stream(CreateHistoryStream::new(author.to_string())).await?;// or with more options enabled
letargs=CreateHistoryStream::new(author.to_string()).keys_values(true,true).after_seq(75).limit(10);lethistory_stream=sbot_client.create_history_stream(args).await?;
Addresses https://git.coopcloud.tech/golgi-ssb/golgi/issues/55
The relevant changes here are in `src/api/history_stream.rs` and `examples/streams.rs`.
Previously we were simply passing the `ssb_id` into `create_history_stream()`. This PR publically exports the [CreateHistoryStreamIn](https://github.com/Kuska-ssb/ssb/blob/master/src/api/dto/history_stream.rs) type from kuska and renames it as `CreateHistoryStream`. `create_history_stream()` now expects a single argument in the form of `CreateHistoryStream` (this is similar to how `SubsetQuery` is passed to `get_subset_stream()`).
This change allows a library user to set additional options for the `create_history_stream` call, including the minimum sequence number and a limit on returned messages.
One question I have for @notplants: do you think `CreateHistoryStream` is consistent with the naming in the rest of golgi? I'm not entirely happy with it...perhaps `HistoryStreamArgs` is better?
-----
Example usage:
```rust
let history_stream = sbot_client.create_history_stream(CreateHistoryStream::new(author.to_string())).await?;
// or with more options enabled
let args = CreateHistoryStream::new(author.to_string()).keys_values(true, true).after_seq(75).limit(10);
let history_stream = sbot_client.create_history_stream(args).await?;
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Addresses #55
The relevant changes here are in
src/api/history_stream.rsandexamples/streams.rs.Previously we were simply passing the
ssb_idintocreate_history_stream(). This PR publically exports the CreateHistoryStreamIn type from kuska and renames it asCreateHistoryStream.create_history_stream()now expects a single argument in the form ofCreateHistoryStream(this is similar to howSubsetQueryis passed toget_subset_stream()).This change allows a library user to set additional options for the
create_history_streamcall, including the minimum sequence number and a limit on returned messages.One question I have for @notplants: do you think
CreateHistoryStreamis consistent with the naming in the rest of golgi? I'm not entirely happy with it...perhapsHistoryStreamArgsis better?Example usage: