diff options
| author | Andy Wingo <wingo@pobox.com> | 2016-12-16 16:45:47 +0100 |
|---|---|---|
| committer | Andy Wingo <wingo@pobox.com> | 2016-12-16 16:45:47 +0100 |
| commit | d19688cfeb47de79d8ef478adbf84b08f05e8dd6 (patch) | |
| tree | bc7caa82ced3e145522603179f33aca2a1f3d3d6 | |
| parent | Add examples to fibers.texi (diff) | |
| download | guile-fibers-d19688cfeb47de79d8ef478adbf84b08f05e8dd6.tar.gz | |
Add REPL commands to manual
| -rw-r--r-- | fibers.texi | 37 | ||||
| -rw-r--r-- | fibers/repl.scm | 2 |
2 files changed, 38 insertions, 1 deletions
diff --git a/fibers.texi b/fibers.texi index b5ccced..b63d379 100644 --- a/fibers.texi +++ b/fibers.texi @@ -388,6 +388,7 @@ operations for channels and timers, and an internals interface. * Operations:: Composable abstractions for concurrency. * Channels:: Share memory by communicating. * Timers:: Operations on time. +* REPL Commands:: Experimenting with Fibers at the console. * Internals:: Scheduler and fiber objects and operations. @end menu @@ -606,6 +607,42 @@ operation will succeed with no values. Block the calling fiber until @var{seconds} have elapsed. @end defun +@node REPL Commands +@section REPL Commands + +Fibers implements some basic extensions to the Guile command-line +interface (its Read-Eval-Print Loop, or the REPL). Prefix these +commands with a comma (@code{,}) to run them at the REPL; see +@code{,help fibers} for full details, once you have loaded the +@code{(fibers)} module of course. + +@deffn {REPL Command} scheds +Show a list of all schedulers. +@end deffn + +@deffn {REPL Command} spawn-sched +Create a new scheduler for fibers, and run it on a new kernel thread. +@end deffn + +@deffn {REPL Command} kill-sched sched +Shut down the scheduler named @var{sched}. Use @code{,scheds} to list +scheduler names. +@end deffn + +@deffn {REPL Command} fibers [sched] +Show a list of all fibers. If @var{sched} is given, limit to fibers +bound to the given scheduler. +@end deffn + +@deffn {REPL Command} spawn-fiber exp [sched] +Spawn a new fiber that runs @var{exp}. If @var{sched} is given, the +fiber will be spawned on the given scheduler. +@end deffn + +@deffn {REPL Command} kill-fiber fiber +Shut down a fiber. +@end deffn + @node Internals @section Internals diff --git a/fibers/repl.scm b/fibers/repl.scm index d340ceb..c4a8bcf 100644 --- a/fibers/repl.scm +++ b/fibers/repl.scm @@ -91,7 +91,7 @@ Shut down a scheduler." "fibers [SCHED] Show a list of fibers. -If SCHED is given, limit to fibers bound to the given fold." +If SCHED is given, limit to fibers bound to the given scheduler." (let ((sched (and sched (or (scheduler-by-name sched) (error "no scheduler with name" sched))))) |
