Skip to content

Comments

Typed/lerna util sequence#29

Merged
negokaz merged 12 commits intomainfrom
typed/lerna-util-sequence
Jun 21, 2021
Merged

Typed/lerna util sequence#29
negokaz merged 12 commits intomainfrom
typed/lerna-util-sequence

Conversation

@tksugimoto
Copy link
Contributor

@tksugimoto tksugimoto commented Jun 10, 2021

#11 v2.0.0 · Issue #11 · lerna-stack/lerna-app-library

Akka Classic 向けに提供している機能を Akka Typed 向けにも提供します

変更内容

  • trait val system: ActorSystem -> val system: ClassicActorSystemProvider
  • インスタンス化test追加
  • typed 化 (typed ActorSystem を使用すると actor を作成できない問題に対処)

参考

関連する問題

#24 typed ActorSystem を new して使うと一部モジュールでエラー · Issue #24 · lerna-stack/lerna-app-library

  • クラシック Props を typed API (Behavior) に書き換える

を選択した。

Extension化は テナント情報 def supportedTenants: Seq[Tenant] をコンストラクタに渡すことができないため、不可

このPRで修正しない既存の改善点/問題

  • SequenceFactoryWorker
    • Initialize が不要
    • SequenceStore.ReservationFailed の handling 漏れ
    • CommandNoSerializationVerificationNeeded を継承したほうが良い
  • SequenceStore
    • OpenSession が不要
    • final case object ReservationFailed extends RuntimeExceptionRuntimeException が不要

Issue にしました。
#35 lerna-util-sequence 改善 · Issue #35 · lerna-stack/lerna-app-library

@tksugimoto tksugimoto force-pushed the typed/lerna-util-sequence branch 4 times, most recently from 77e015c to 71f6620 Compare June 14, 2021 10:31
※ 現時点では落ちる
> java.lang.UnsupportedOperationException: cannot create top-level actor [SequenceFactory-29550e6c-e546-4593-912c-43bba3a0c663-dummy] from the outside on ActorSystem with custom user guardian
@tksugimoto tksugimoto force-pushed the typed/lerna-util-sequence branch 3 times, most recently from f93a4b3 to a0c8c6c Compare June 15, 2021 08:48
原因
> java.lang.UnsupportedOperationException: cannot create top-level actor from the outside on ActorSystem with custom user guardian

Actor の定義を typed に変更し、 system.actorOf を 使用しないように変更
デフォルト restart であるため。
typed 化によって exception のログ出力がなくなったため差異がなくなった
@tksugimoto tksugimoto force-pushed the typed/lerna-util-sequence branch from a0c8c6c to f285801 Compare June 15, 2021 10:51
@tksugimoto tksugimoto marked this pull request as ready for review June 15, 2021 10:51
This reverts commit cc41961.

設計意図(その例外が起きたときにどう対処すべきなのか)を示す目的で消さずに残しておく
Akka が提供するAPIなのでより適切
Akka ドキュメントで使用されている Behavior に可能な限り統一
Copy link
Contributor

@negokaz negokaz left a comment

Choose a reason for hiding this comment

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

LGTM! 🎉

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