Skip to content

Commit

Permalink
Fix docs generation
Browse files Browse the repository at this point in the history
  • Loading branch information
attdona committed Jun 21, 2024
1 parent d23d426 commit 929be4c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions docs/src/supervisor.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ using Visor
function tsk1(task)
sleep(1)
error("[$(task.id)]: critical failure")
return error("[$(task.id)]: critical failure")
end
function tsk2(task)
while true
count = 0
while count < 8
println("[$(task.id)]: do something ...")
sleep(0.5)
count += 1
end
end
Expand Down Expand Up @@ -88,5 +90,5 @@ Finally there can be two types of life span for supervisor: `:permanent` and `:t
The `:transient` supervisor terminates when there are left no children to supervise, whereas the `:permanent`
supervisor may outlives its supervised children.

The `wait` option controls if `supervise` blocks or return control. In the latter case it is responsability of the caller to
wait for supervision termination.
The `wait` option controls if `supervise` blocks or return control. In the latter case the caller have
to wait for supervision termination.
6 changes: 3 additions & 3 deletions examples/stop_process.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#' # How to stop supervised tasks
#'
#' In Julia parlance a task is just a function that runs as a coroutine.
#'
#'
#' A task managed by [Visor](https://github.com/cardo-org/Visor) differs from a
#' standard julia task because it is a function
#' that requires as its first argument an handle representing the
#' supervised task.
#'
#' In the following examples the handle `self` it is not used to communicate
#' with the task using the `inbox` channel
#' but just to check if a shutdown request was delivered and in this case it stops the task.
#' but just to check if a shutdown request was delivered and in this case it stops the task.
#'
#' The task `fair_task` is a `Visor.process`: it is a cooperative task that
#' checks itself for a shutdown request and acts accordingly.
Expand All @@ -22,7 +22,7 @@ function fair_task(self)
println("[$(self.id)] cleanup and resources deallocation")
break
end
sleep(2)
sleep(0.5)
end
return println("[$(self.id)] DONE")
end
Expand Down

0 comments on commit 929be4c

Please sign in to comment.