Feature Request: Add `Observable.usingWhen()` for resources generated by a `Publisher`
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- java
調査の方向性
まず、既存の Single.using() の動作を確認し、Reactor の Mono.usingWhen() のセマンティクスと比較します。成功、エラー、終了、破棄のそれぞれにおけるクリーンアップについて Observable.usingWhen() の動作を定義し、それらのケースのカバレッジを追加します。Publisher によって作成されたリソースとそのクリーンアップがネイティブでサポートされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Version: 3.1.6
In Reactor, there is Mono.usingWhen(), which works similarly to Mono.using(), but supports resources that are generated and cleaned up with a Publisher.
For example, here's a use case in r2dbc-pool:
Mono<Object> result = Mono.usingWhen(
connectionFactory.create(), // Publisher<Connection>
connection -> executeQuery(connection),
Connection::close // Publisher<Void>
);
In RxJava, we have Single.using(), which works the same way as Mono.using(), so there's no support for reactive resource generation/cleanup. I was thinking of doing something like this:
Single<Object> result = Single
.fromPublisher(connectionFactory.create())
.flatMap(connection -> executeQuery(connection)
.flatMap(result -> Completable
.fromPublisher(connection.close())
.toSingleDefault(result)));
However, this does not handle cases like connection cleanup on error, dispose or terminate. The .doOnXyz() methods would not suffice, so I'm guessing this would require a custom Observable implementation, unless I'm missing something obvious. I've also checked RxJavaExtensions for anything similar to what I'm trying to achieve, but I was not able to find anything, nor could I find anything relevant on Stack Overflow.
I currently have the option of just using Mono.usingWhen() and then convert it to a Single, but it would be nice to have this natively available in RxJava. Would you be willing to add support for usingWhen()?
- 主要言語
- Java
- スター
- 48.2k
- フォーク
- 7.6k
- 平均マージ
- 3時間 2分
- マージ済み PR(30日)
- 27
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ReactiveX/RxJava のほかの issue
-
4.x Streamable Test-Failures
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
4.x AI Enhancement Streamable
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
ReactiveX/RxJava#8299 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
4.x: FlowableBufferTest > longTimeAction() FAILED再び着手できるかも @akarnokd が 81 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン4.x Test-Failures
ReactiveX/RxJava#8280 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
4.x Discussion
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
4.x PR welcome Test Test-Failures
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
ReactiveX/RxJava#8075 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
ReactiveX/RxJava の issue をすべて見る
似ている issue
-
area: triage theme: undefined
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
jhipster/generator-jhipster#35895 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
oracle/graalvm-reachability-metadata#11659 ·
メンテナーはふだん 1 日以内に返信
-
Build failure report and inbox copy miss a proof split by colour codes, which the build log redactsオープンbug follow-up
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
Sanne/incus-spawn#1864 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
openhab/openhab-addons#22135 ·
メンテナーはふだん 1 日以内に返信