"""
Shared Leader Election for Bakery-IA platform

Provides Redis-based leader election for services that need to run
singleton scheduled tasks (APScheduler, background jobs, etc.)

Usage:
    from shared.leader_election import LeaderElectionService, SchedulerLeaderMixin

    # Option 1: Direct usage
    leader_election = LeaderElectionService(redis_client, "my-service")
    await leader_election.start(
        on_become_leader=start_scheduler,
        on_lose_leader=stop_scheduler
    )

    # Option 2: Mixin for services with APScheduler
    class MySchedulerService(SchedulerLeaderMixin):
        async def _create_scheduler_jobs(self):
            self.scheduler.add_job(...)
"""

from shared.leader_election.service import (
    LeaderElectionService,
    LeaderElectionConfig,
)
from shared.leader_election.mixin import SchedulerLeaderMixin

__all__ = [
    "LeaderElectionService",
    "LeaderElectionConfig",
    "SchedulerLeaderMixin",
]
