View Source F1Bot.F1Session (f1_bot v0.7.0)

Holds all state related to a given F1 session and coordinates data processing across modules in F1Bot.F1Session scope.

All code in this scope is fully functional, without side effects. To communicate with other components that have side effects, such as posting to Discord, it generates events that are processed by the caller, i.e. F1Bot.F1Session.Server.

Link to this section Summary

Types

t()

F1 Session State

Link to this section Types

@type t() :: %F1Bot.F1Session{
  clock: F1Bot.F1Session.Clock.t() | nil,
  driver_cache: F1Bot.F1Session.DriverCache.t(),
  driver_data_repo: F1Bot.F1Session.DriverDataRepo.t(),
  event_generator: F1Bot.F1Session.EventGenerator.t(),
  lap_counter: F1Bot.F1Session.LapCounter.t(),
  race_control: F1Bot.F1Session.RaceControl.t(),
  session_info: F1Bot.F1Session.SessionInfo.t(),
  session_status: atom() | nil,
  track_status_history: F1Bot.F1Session.TrackStatusHistory.t()
}

F1 Session State

Link to this section Functions

Link to this function

driver_info_by_abbr(session, driver_abbr)

View Source
Link to this function

driver_info_by_number(session, driver_number)

View Source
Link to this function

driver_session_data(session, driver_number)

View Source
Link to this function

driver_summary(session, driver_number)

View Source
Link to this function

make_state_sync_events(session, local_time)

View Source

See F1Bot.F1Session.EventGenerator.make_state_sync_events/2.

Link to this function

periodic_tick(session, local_time)

View Source
Link to this function

process_transcript(session, transcript)

View Source
Link to this function

push_driver_list_update(session, drivers)

View Source
Link to this function

push_lap_counter_update(session, current_lap, total_laps, timestamp)

View Source
Link to this function

push_position(session, driver_number, position)

View Source
Link to this function

push_race_control_messages(session, messages)

View Source
Link to this function

push_session_info(session, session_info, local_time, ignore_reset)

View Source
Link to this function

push_session_status(session, session_status)

View Source
Link to this function

push_stint_data(session, driver_number, stint_data, skip_heavy_events \\ false)

View Source
Link to this function

push_telemetry(session, driver_number, channels)

View Source
Link to this function

push_timing_data(session, timing_data, skip_heavy_events \\ false)

View Source
Link to this function

push_track_status(session, track_status, timestamp)

View Source
Link to this function

reset_session(session, local_time)

View Source
Link to this function

session_best_stats(session)

View Source
Link to this function

session_clock_from_local_time(session, local_time)

View Source
Link to this function

update_clock(session, server_time, local_time, remaining, is_running)

View Source