pallet.phase documentation

A phase is a function of a single session argument, that contains calls to crate functions or actions. A phase has an implicitly defined pre and post phase.

all-phases-for-phase

[phase]

Return a sequence including the implicit pre and post phases for a phase.

check-session

[session]
[session form]

Function that can check a session map to ensure it is a valid part of phase definiton. It returns the session map.

If this fails, then it is likely that you have an incorrect crate function, which is failing to return its session map properly, or you have a non crate function in the phase defintion.

check-session-thread

[arg & body]

Add session checking to a sequence of calls which thread a session map. e.g.

(->
  session
  (check-session-thread
    (file "/some-file")
    (file "/other-file")))

The example is thus equivalent to:

(-> session
  (check-session "The session passed to the pipeline")
  (check-session (file "/some-file"))
  (check-session (file "/other-file")))

phase-fn

[& body]

Create a phase function from a sequence of crate invocations with an ommited session parameter.

eg. (phase-fn (file "/some-file") (file "/other-file"))

which generates a function with a session argument, that is thread through the function calls. The example is thus equivalent to:

(fn [session] (-> session (file "/some-file") (file "/other-file")))

post-phase-name

[phase]

Return the name for the post-phase for the given phase.

pre-phase-name

[phase]

Return the name for the pre-phase for the given phase.

schedule-in-post-phase

[session & body]

Specify that the body should be executed in the post-phase.

schedule-in-pre-phase

[session & body]

Specify that the body should be executed in the pre-phase.

subphase-for

[phase]

Return the phase this is a subphase for, or nil if not a subphase