5Ec      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abNone"$6a`EcAConvenience utility record that contains all values related to a Capataz=; this is used on internal functions of the Capataz library.d Dhttp://erlang.org/doc/design_principles/sup_princ.html#max_intensityeBInternal record used to hold part of the runtime information of a Capataz recordRecord that contains the environment of a capataz monitor, this is used as the main record to create workers and to stop the supervisor thread.f}Internal message delivered to a Capataz thread that can either be a call from public API or an event from a monitored WorkerCInternal state machine record that indicates the state of a CapatazLThis state is set when Worker is created and it spawn static worker threads AThis state is set when the Capataz thread is listenting to both  ControlAction and  MonitorEvent messages NThis state is set when the Capataz thread is terminating it's assigned worker The Capataz thread is donegrInternal event delivered from Worker threads to the Capataz thread to indicate completion, failure or termination >Internal exception triggered when a callback of a Worker failstInternal record that indicates what type of callback function is being invoked; this is used for telemetry purposeshRInternal exception triggered when a Worker violates error intensity specificationiSInternal exception thrown to the Capataz loop to indicate termination of executionj`Internal record that represents an action being sent from threads using the Capataz public API.kAConvenience utility record that contains all values related to a Worker=; this is used on internal functions of the Capataz library.lRecord that contains the Async& record (thread reference) of a workerm0Unique identifier for a worker that is executingnAsync- thread of a worker, this Async executes the IO () sub-routineoDTime where this worker was created (used for error intensity checks)pName of the Worker (present on  CapatazEvent records)q WorkerSpecB contains all the options around restart and termination policies&WorkerSpec is a representation of the  WorkerOptions record that embeds the IO ()b sub-routine of the worker thread. This record is used when we want to bound worker threads to a Capataz instanceAn IO () sub-routine that will be executed when the worker thread is created, this attribute is lazy given we want to this value on a worker thread environment.Name of the Worker (present on  CapatazEvent records)1Callback used when the worker fails with an error?Callback used when the worker completes execution without error+Callback used when the worker is terminated+Indicates how a worker should be terminated*Indicates how a worker should be restartedSpecifies how a Worker' should restart on failure. Default is  Transient Worker thread is always restarted!,Worker thread is restarted only if it failed"Worker thread is never restarted#,Utility record used to specify options to a Worker instance%Name of the Worker (present on  CapatazEvent records)&1Callback used when the worker fails with an error'?Callback used when the worker completes execution without error(+Callback used when the worker is terminated)+Indicates how a worker should be terminated**Indicates how a worker should be restarted+,Utility record used to specify options to a Capataz instance- Name of the Capataz (present on  CapatazEvent records).:How many errors is the Capataz be able to handle; check: Dhttp://erlang.org/doc/design_principles/sup_princ.html#max_intensity/QPeriod of time where the Capataz can receive "capatazIntensity" amount of errors0 What is the CapatazRestartStrategy for this Capataz10Static set of workers that start as soon as the Capataz is created2In which order the Capataz* record is going to terminate it's workers31Callback used when the error intensity is reached4$Callback used for telemetry purposes5ESpecifies how a Capataz should restart a failing worker. Default is  OneForOne6ATerminate all workers threads when one fails and restart them all7&Only restart worker thread that failed8sSpecifies how order in which workers should be terminated by a Capataz in case of restart or shutdown; default is  OldestFirst93Terminate worker threads from most recent to oldest:3Terminate worker threads from oldest to most recentrHHelper record to assess if the capataz error intensity has been breachedsiThe capataz will restart the failed worker and reset the restart count given intensity period has passedtIThe capataz will restart the failed worker and increase the restart countu$The error intensity has been reached;Defines how a Worker) termination should be handled, default WorkerTerminationPolicy is 3 seconds<0Waits until infinity for the worker to terminate=:Worker is terminated wihtout a chance to call its callback>kAllows n milliseconds for worker termination callback to be executed, otherwise "BrutalTermination occurs"?Event passed to the "notifyEvent" callback sub-routine, this events can be used to monitor the capataz system and understanding what is doing. This provides high levels of telemetry for the Capataz instance, so is mainly used for logging, monitoring and testing purposes.\Default options to easily create capataz instances: * name defaults to "default-capataz" * intensity error tolerance is set to 1 error every 5 seconds * has a "OneForOne " capataz restart strategy * has a termination order of  OldestFirst]aDefault options to easily create worker instances: * name defaults to "default-worker" * has a  TransientI worker restart strategy * has a termination policy of three (3) seconds^3Default spec to easily create worker instances: * IO ()O sub-routine simply returns unit * name defaults to "default-worker" * has a  TransientI worker restart strategy * has a termination policy of three (3) secondscvwxyz{|}~def  g hijklqonpm"! #$*)('&%+,43210/.-5768:9ruts;>=<?LKJIHGFEDCBA@ZYXWVUTSRQPONM[\]^cvzyxw{d~}|ef g  hij k lmnopq !"#$%&'()*+ ,-./0123456789:rstu;<=>?P@ABCDEFGHIJKLMNOMNPQONMRSTUONMRSTONMRSTVONMRSTONMRSTWONMRSTXYONMUONMUONMZONMONMONone"#$a'Returns only the number of the ThreadId Fetches a Worker from the Capataz instance environment Fetches a  WorkerEnv from the Capataz instance environmentAppends a new Worker to the Capataz existing worker map. Removes a Worker from the Capataz existing worker map.Function to modify a Capataz" worker map using a pure function."Function to get a snapshot of the Capataz ' worker mapReturns all worker's of a Capataz by WorkerTerminationOrder. This is used  AllForOne" restarts and shutdown operations.Sub-routine that returns the  CapatazStatus), this sub-routine will block until the Capataz has a status different from  Initializing.Sub-routine that returns the  CapatazStatus on the IO monad Modifes the Capataz status, this is the only function that should be used to this end given it has the side-effect of notifying a status change via the "notifyEvent" sub-routine, given via an attribute of the  CapatazOption record.]Used from public API functions to send a ControlAction to the Capataz supervisor thread loopUsed from public API functions to send a ControlAction to the Capataz supervisor thread loop, it receives an IO sub-routine that expects an IO operation that blocks a thread until the message is done. Utility function to transform a CapatazRuntime into a  CapatazEnv Utility function to transform a Worker into a  WorkerEnv Utility function to transform a  WorkerEnv into a Worker Utility function to transform a  WorkerOptions into a  WorkerSpec_ Utility function to transform a Capataz into an Async ())Blocking sub-routine used from the caller_None"$aheInternal functions that overwrites the GHC thread name, for increasing traceability on GHC internalsFHandles errors caused by the execution of the "workerMain" sub-routine2Handles completion of the "workerMain" sub-routineDecorates the given IO ()" sub-routine with failure handling(Internal function used to send a proper  CapatazEvent< to the "notifyEvent" callback, this event can either be a  WorkerStarted or a WorkerRestartedlInternal function that forks a worker thread on the Capataz thread; note this is different from the public  forkWorker4 function which sends a message to the capataz looplInternal function that forks a worker thread on the Capataz thread; note this is different from the public  forkWorker4 function which sends a message to the capataz loopfInternal sub-routine that terminates workers of a Capataz, used when a Capataz instance is terminated.Text that indicates why there is a terminationNone"$Val ZFunction used to track difference between two timestamps to track capataz error intensity{Function that checks restart counts and worker start time to assess if the capataz error intensity has been breached, see WorkerRestartAction for possible outcomes.'Sub-routine responsible of executing a CapatazRestartStrategyMExecutes a restart action returned from the invokation of "calcRestartAction"Restarts _all_ the worker green thread of a Capataz, invoked when one worker green thread fails and causes sibling worker threads to get restarted as wellSSub-routine that is used when there is a restart request to a Worker caused by an  AllForOne' restart from a failing sibling worker.;Starts a new worker thread taking into account an existing WorkerId and keeping a  RestartCount# to manage Capataz error intensity.This sub-routine is responsible of the restart strategies execution when a supervised worker finishes it execution because of a completion (e.g. worker sub-routine finished without any errors).This sub-routine is responsible of the restart strategies execution when a supervised worker finishes it execution because of a failure.This sub-routine is responsible of the restart strategies execution when a supervised worker finishes it execution because of a termination. None"#$QV kExecutes the shutdown operation of a Capataz, including the termination of Workers being supervised by it.EHandles an event produced by one of the workers this capataz monitors-Handles an action triggered by the public API8Handles all messages that a capataz instance can receiveJHandles errors caused by the execution of the "runCapatazLoop" sub-routine"This is the main thread loop of a Capataz instance2Builds a record that contains runtime values of a Capataz (id, queue, status, etc.)`yCreates a Capataz record, which represents a supervision thread which monitors failure on worker threads defined in the CapatazOptionsD or worker threads that are created dynamically using "forkWorker".a\Creates a worker green thread "IO ()" sub-routine, and depending in options defined in the  WorkerOptionsD record, it will restart the Worker sub-routine in case of failuresbLStops the execution of a worker green thread being supervised by the given Capatazk instance, if the WorkerId does not belong to the Capataz, the operation does not perform any side-effect.Note: If your worker has a  Permanent- worker restart strategy, the worker thread will be restarted again ; so use a  Transient restart strategy instead.a.Worker options (restart, name, callbacks, etc)5IO sub-routine that will be executed on worker threadCapataz$ instance that supervises the worker0An identifier that can be used to terminate the Worker `abNonec   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ab[ #$%&'()* !"89:;<=>?@ABCDEFGHIJKLMNOMNPQONMRSTUONMRSTONMRSTVONMRSTONMRSTWONMRSTXYONMUONMUONMZONMONMO+,-./01234567 ]^\a`b_Safe      !"#$%&'()*++,-./01223456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{i|}~kmpqrgh&capataz-0.0.0.2-39qawcAUyl65X7owujVgXHControl.Concurrent.Capataz)Control.Concurrent.Internal.Capataz.Types(Control.Concurrent.Internal.Capataz.Util*Control.Concurrent.Internal.Capataz.Worker+Control.Concurrent.Internal.Capataz.Restart(Control.Concurrent.Internal.Capataz.Core Paths_capataz'teardown-0.3.0.0-73OIbqinYW2FvuhUhTS9VFControl.Teardown.Internal.TypesteardownCapataz$sel:capatazRuntime:Capataz$sel:capatazEnv:Capataz$sel:capatazAsync:Capataz$sel:capatazTeardown:Capataz CapatazStatus InitializingRunningHaltingHalted WorkerErrorWorkerCallbackFailed"$sel:workerId:WorkerCallbackFailed+$sel:workerActionError:WorkerCallbackFailed&$sel:callbackType:WorkerCallbackFailed-$sel:workerCallbackError:WorkerCallbackFailed CallbackType OnCompletion OnFailure OnTermination WorkerSpec$sel:workerAction:WorkerSpec$sel:workerName:WorkerSpec$sel:workerOnFailure:WorkerSpec"$sel:workerOnCompletion:WorkerSpec#$sel:workerOnTermination:WorkerSpec'$sel:workerTerminationPolicy:WorkerSpec%$sel:workerRestartStrategy:WorkerSpecWorkerRestartStrategy Permanent Transient Temporary WorkerOptions$sel:workerName:WorkerOptions"$sel:workerOnFailure:WorkerOptions%$sel:workerOnCompletion:WorkerOptions&$sel:workerOnTermination:WorkerOptions*$sel:workerTerminationPolicy:WorkerOptions($sel:workerRestartStrategy:WorkerOptionsCapatazOptions$sel:capatazName:CapatazOptions$$sel:capatazIntensity:CapatazOptions($sel:capatazPeriodSeconds:CapatazOptions*$sel:capatazRestartStrategy:CapatazOptions)$sel:capatazWorkerSpecList:CapatazOptions1$sel:capatazWorkerTerminationOrder:CapatazOptions-$sel:onCapatazIntensityReached:CapatazOptions$sel:notifyEvent:CapatazOptionsCapatazRestartStrategy AllForOne OneForOneWorkerTerminationOrder NewestFirst OldestFirstWorkerTerminationPolicyInfinityBrutalTermination TimeoutMillis CapatazEventInvalidCapatazStatusReachedCapatazStatusChangedWorkerTerminated WorkerStartedWorkerRestartedWorkerCompleted WorkerFailedWorkerCallbackExecutedWorkersTerminationStartedWorkersTerminationFinished CapatazFailedCapatazTerminatedCapatazShutdownInvoked*$sel:capatazId:InvalidCapatazStatusReached,$sel:capatazName:InvalidCapatazStatusReached*$sel:eventTime:InvalidCapatazStatusReached2$sel:prevCapatazStatus:InvalidCapatazStatusReached1$sel:newCapatazStatus:InvalidCapatazStatusReached/$sel:workerThreadId:InvalidCapatazStatusReached)$sel:workerId:InvalidCapatazStatusReached+$sel:workerName:InvalidCapatazStatusReached2$sel:terminationReason:InvalidCapatazStatusReached3$sel:workerRestartCount:InvalidCapatazStatusReached,$sel:workerError:InvalidCapatazStatusReached4$sel:workerCallbackError:InvalidCapatazStatusReached-$sel:callbackType:InvalidCapatazStatusReached-$sel:capatazError:InvalidCapatazStatusReached WorkerActiondefCapatazOptionsdefWorkerOptions defWorkerSpeccapatazToAsync forkCapataz forkWorkerterminateWorker CapatazEnv $sel:capatazIntensity:CapatazEnvCapatazRuntimeCapatazMessage MonitorEvent CapatazError CapatazSignal ControlAction WorkerEnvWorker$sel:workerId:Worker$sel:workerAsync:Worker$sel:workerCreationTime:Worker$sel:workerName:Worker$sel:workerSpec:WorkerWorkerRestartActionResetRestartCountIncreaseRestartCount HaltCapataz$sel:capatazOptions:CapatazEnv $sel:capatazStatusVar:CapatazEnv $sel:capatazWorkerMap:CapatazEnv$sel:capatazQueue:CapatazEnv$sel:capatazRuntime:CapatazEnv$sel:notifyEvent:CapatazEnv)$sel:onCapatazIntensityReached:CapatazEnv-$sel:capatazWorkerTerminationOrder:CapatazEnv&$sel:capatazRestartStrategy:CapatazEnv$$sel:capatazPeriodSeconds:CapatazEnv$sel:capatazName:CapatazEnv$sel:capatazId:CapatazEnv"$sel:capatazOptions:CapatazRuntime$$sel:capatazStatusVar:CapatazRuntime$$sel:capatazWorkerMap:CapatazRuntime $sel:capatazQueue:CapatazRuntime$sel:capatazId:CapatazRuntimeWorkerForcedRestartWorkerCompleted' WorkerFailed'WorkerTerminated''$sel:monitorEventTime:WorkerTerminated'.$sel:workerTerminationReason:WorkerTerminated'"$sel:workerError:WorkerTerminated')$sel:workerRestartCount:WorkerTerminated'!$sel:workerName:WorkerTerminated'$sel:workerId:WorkerTerminated'CapatazIntensityReached/$sel:workerRestartCount:CapatazIntensityReached'$sel:workerName:CapatazIntensityReached%$sel:workerId:CapatazIntensityReached BrutallyTerminateWorkerExceptionTerminateWorkerExceptionRestartWorkerException3$sel:workerTerminationReason:RestartWorkerException$$sel:workerId:RestartWorkerExceptionTerminateCapatazTerminateWorker ForkWorker($sel:notifyCapatazTermination:ForkWorker'$sel:notifyWorkerTermination:ForkWorker$sel:returnWorkerId:ForkWorker$sel:workerSpec:ForkWorker!$sel:terminationReason:ForkWorker$sel:workerId:ForkWorker$sel:workerSpec:WorkerEnv!$sel:workerCreationTime:WorkerEnv$sel:workerAsync:WorkerEnv$sel:workerAction:WorkerEnv$$sel:workerRestartStrategy:WorkerEnv"$sel:workerOnTermination:WorkerEnv!$sel:workerOnCompletion:WorkerEnv$sel:workerOnFailure:WorkerEnv$sel:workerName:WorkerEnv$sel:workerId:WorkerEnv WorkerMap RestartCount WorkerName CapatazNameWorkerThreadIdWorkerId CapatazId getTidNumber fetchWorkerfetchWorkerEnvappendWorkerToMapremoveWorkerFromMapresetWorkerMap readWorkerMapsortWorkersByTerminationOrderreadCapatazStatusSTMreadCapatazStatuswriteCapatazStatussendControlMsgsendSyncControlMsg capatazToEnv workerToEnv envToWorkerworkerOptionsToSpecsetWorkerThreadNamehandleWorkerExceptionhandleWorkerCompletion workerMainnotifyWorkerStartedterminateWorkerscalcDiffSecondscalcRestartActionexecCapatazRestartStrategyexecRestartActionrestartWorkersforceRestartWorker restartWorkerhandleWorkerCompletedhandleWorkerFailedhandleWorkerTerminated haltCapatazhandleMonitorEventhandleControlActionhandleCapatazMessagehandleCapatazExceptionrunCapatazLoopbuildCapatazRuntimeversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName