A family of sessions constrained against each other.
Every other constraint in this library relates a session to a resource. A track is the first that does not: it says these sessions share an audience, so no two of them may run at once, and — if asked — a delegate must be able to walk between consecutive ones in the gap between them.
Not overlapping is intrinsic, not an option. A set of sessions
that may collide with each other is just a list; what makes a track a
track is that it cannot clash with itself. reachable/2 is the
optional extra.
The word is deliberately not "stream": Elixir's Stream owns that
name and a conference stream would shadow it at every call site.
Example
iex> import Tempo.Sigils
iex> keynote = Agenda.session("Keynote", duration: ~o"PT1H")
iex> deep_dive = Agenda.session("OTP internals", duration: ~o"PT1H")
iex> {:ok, track} =
...> Agenda.track("Elixir", of: [keynote, deep_dive])
...> |> Agenda.Track.reachable(within: ~o"PT10M")
iex> {length(track.sessions), track.reachable_within}
{2, ~o"PT10M"}"No two talks in the Elixir track may overlap, and a delegate must be able to walk between consecutive ones inside the ten-minute break."
Summary
Functions
Add a session to the track.
Build a track.
Require that a delegate can get between consecutive sessions.
The names of the sessions in track.
Types
@type t() :: %Agenda.Track{ name: String.t(), reachable_within: Agenda.Availability.pattern() | nil, sessions: [Agenda.Session.t()] }
Sessions that cannot clash with each other.
Functions
@spec add(t(), Agenda.Session.t()) :: t()
Add a session to the track.
Arguments
trackis at/0.sessionis aAgenda.Session.t/0.
Returns
- the track, with the session added.
Examples
iex> session = Agenda.session("Keynote")
iex> track = Agenda.Track.add(Agenda.Track.new("Elixir"), session)
iex> Enum.map(track.sessions, & &1.name)
["Keynote"]
Build a track.
Arguments
nameis the track's name.
Options
:ofis the list ofAgenda.Session.t/0in the track. The default is[].
Returns
- a
t/0.
Examples
iex> Agenda.Track.new("Elixir").name
"Elixir"
Require that a delegate can get between consecutive sessions.
Two sessions running back to back in rooms twenty minutes apart, with a ten-minute break, cannot both be attended. This is what makes the place tree earn its keep — the journey is derived from where the rooms are, not configured per pair.
Arguments
trackis at/0.
Options
:withinis the longest journey a delegate is expected to make, a duration.
Returns
{:ok, track}with the reachability requirement set; or{:error, {:missing_option, :within}}.
Examples
iex> import Tempo.Sigils
iex> track = Agenda.Track.new("Elixir")
iex> {:ok, track} = Agenda.Track.reachable(track, within: ~o"PT10M")
iex> track.reachable_within
~o"PT10M"
iex> Agenda.Track.reachable(Agenda.Track.new("Elixir"), [])
{:error, {:missing_option, :within}}
The names of the sessions in track.
Arguments
trackis at/0.
Returns
- the session names, in track order.
Examples
iex> track = Agenda.track("Elixir", of: [Agenda.session("Keynote")])
iex> Agenda.Track.session_names(track)
["Keynote"]