Skip to content

[REFACTOR] publisher 책임 인터페이스 위치 정합성 — SeedPublisher 이동 + 메타 #385 원칙 명문화 #396

Description

@juhy0987

부모

부모 메타: #385 (Publisher 통합 모듈화)
직전 PR: #395 (Sub 2 — scheduler.JobEmitter → publisher.PublishSeed) — 머지됨

배경

PR #395 에서 `SeedPublisher` 인터페이스를 `internal/scheduler/source.go` 에 정의함. 이유는 Go idiomatic "consumer-defined interface" 패턴.

그러나 메타 #385 의 의도 "Kafka I/O 단일 책임 hub = publisher" 와 정합 깨짐:

  • `PublishSeed` 의 시그니처 / 계약을 정의하는 인터페이스가 scheduler 측 에 있음
  • publisher 가 "우연히" 만족하는 형태 — 단일 진실 원천 깨짐
  • 신규 개발자가 `PublishSeed` 계약 찾으려면 두 곳 (interface 정의 + 구현) 봐야 함

작업 범위

1. `SeedPublisher` 인터페이스 이동

  • `internal/scheduler/source.go` 에서 제거
  • `internal/publisher/seed.go` 에 추가
  • `scheduler.Scheduler` 는 publisher 패키지에서 `publisher.SeedPublisher` import

2. 메타 #385 원칙 명문화 (코멘트)

모든 publisher 책임 인터페이스 (`SeedPublisher` / `UpgradePublisher` / `RetryPublisher` / `ChainPublisher` 등) 는 publisher 패키지에서 정의 — 단일 진실 원천.

3. 후속 sub 들 적용

영향 / 위험

  • Low — 인터페이스 위치 이동 + import path 변경. 동작 변경 없음.
  • 호출 시그니처 무변경 (`PublishSeed(ctx, *core.CrawlJob) error`).
  • scheduler 의 mock 도 동일 시그니처 만족하면 됨.

완료 조건

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorCode refactoring

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions