Make HazelcastClient context manager aware (PEP-343)

オープン
#638 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
api

調査の方向性

HazelcastClient のエントリーポイントから始め、ここで要求されているコンテキストマネージャーの動作について PEP 343 を確認してください。with 文で HazelcastClient を使用すると、ブロック内でクライアントが利用可能になり、ブロック終了時に shutdown が呼び出され、issue に示されている明示的な shutdown 呼び出しが置き換えられることを確認してください。

索引モデルが issue の本文から書いたものです。

説明

Source: Community

Sorry, if the issue like this was opened before, I've searched but not found it.

Is it possible to make a HazelcastClient conext manager aware, see https://peps.python.org/pep-0343/

In short:

To be able instead of:

client = hazelcast.HazelcastClient(...)
# operations
client.shutdown()

make calls like this:

with hazelcast.HazelcastClient(...) as client:
    # operatoins...
    # no need to call client.shutdown() - it will be called by context manager

May be there are some other classes that could be also made context manager aware.

Thanks!

主要言語
Python
スター
115
フォーク
78
平均マージ
2日 23時間
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

hazelcast/hazelcast-python-client のほかの issue

hazelcast/hazelcast-python-client の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。