| Line 1... |
Line 1... |
| 1 |
% File src/library/base/man/taskCallbackManager.Rd
|
1 |
% File src/library/base/man/taskCallbackManager.Rd
|
| 2 |
% Part of the R package, https://www.R-project.org
|
2 |
% Part of the R package, https://www.R-project.org
|
| 3 |
% Copyright 1995-2016 R Core Team
|
3 |
% Copyright 1995-2019 R Core Team
|
| 4 |
% Distributed under GPL 2 or later
|
4 |
% Distributed under GPL 2 or later
|
| 5 |
|
5 |
|
| 6 |
\name{taskCallbackManager}
|
6 |
\name{taskCallbackManager}
|
| 7 |
\alias{taskCallbackManager}
|
7 |
\alias{taskCallbackManager}
|
| 8 |
\title{Create an R-level Task Callback Manager}
|
8 |
\title{Create an R-level Task Callback Manager}
|
| Line 46... |
Line 46... |
| 46 |
This is useful for debugging callbacks and the handler
|
46 |
This is useful for debugging callbacks and the handler
|
| 47 |
itself.
|
47 |
itself.
|
| 48 |
}
|
48 |
}
|
| 49 |
}
|
49 |
}
|
| 50 |
\value{
|
50 |
\value{
|
| 51 |
A list containing 6 functions:
|
51 |
A \code{\link{list}} containing 6 functions:
|
| 52 |
\item{add}{register a callback with this manager, giving the
|
52 |
\item{\code{add()}}{register a callback with this manager, giving the
|
| 53 |
function, an optional 5-th argument, an optional name
|
53 |
function, an optional 5-th argument, an optional name
|
| 54 |
by which the callback is stored in the list,
|
54 |
by which the callback is stored in the list,
|
| 55 |
and a \code{register} argument which controls whether
|
55 |
and a \code{register} argument which controls whether
|
| 56 |
the \code{evaluate} function is registered with the internal
|
56 |
the \code{evaluate} function is registered with the internal
|
| 57 |
C-level dispatch mechanism if necessary.}
|
57 |
C-level dispatch mechanism if necessary.}
|
| 58 |
\item{remove}{remove an element from the manager's collection
|
58 |
\item{\code{remove()}}{remove an element from the manager's collection
|
| 59 |
of callbacks, either by name or position/index.}
|
59 |
of callbacks, either by name or position/index.}
|
| 60 |
\item{evaluate}{the \sQuote{real} callback function that is registered
|
60 |
\item{\code{evaluate()}}{the \sQuote{real} callback function that is registered
|
| 61 |
with the C-level dispatch mechanism and which invokes each of the
|
61 |
with the C-level dispatch mechanism and which invokes each of the
|
| 62 |
R-level callbacks within this manager's control.}
|
62 |
R-level callbacks within this manager's control.}
|
| 63 |
\item{suspend}{a function to set the suspend state
|
63 |
\item{\code{suspend()}}{a function to set the suspend state
|
| 64 |
of the manager. If it is suspended, none of the callbacks will be
|
64 |
of the manager. If it is suspended, none of the callbacks will be
|
| 65 |
invoked when a task is completed. One sets the state by specifying
|
65 |
invoked when a task is completed. One sets the state by specifying
|
| 66 |
a logical value for the \code{status} argument.
|
66 |
a logical value for the \code{status} argument.
|
| 67 |
}
|
67 |
}
|
| 68 |
\item{register}{a function to register the \code{evaluate}
|
68 |
\item{\code{register()}}{a function to register the \code{evaluate}
|
| 69 |
function with the internal C-level dispatch mechanism. This is
|
69 |
function with the internal C-level dispatch mechanism. This is
|
| 70 |
done automatically by the \code{add} function, but can be called
|
70 |
done automatically by the \code{add} function, but can be called
|
| 71 |
manually.}
|
71 |
manually.}
|
| 72 |
\item{callbacks}{returns the list of callbacks being maintained by this
|
72 |
\item{\code{callbacks()}}{returns the list of callbacks being maintained
|
| 73 |
manager.}
|
73 |
by this manager.}
|
| 74 |
}
|
74 |
}
|
| 75 |
\seealso{
|
75 |
\seealso{
|
| 76 |
\code{\link{addTaskCallback}},
|
76 |
\code{\link{addTaskCallback}},
|
| 77 |
\code{\link{removeTaskCallback}},
|
77 |
\code{\link{removeTaskCallback}},
|
| 78 |
\code{\link{getTaskCallbackNames}}\\
|
78 |
\code{\link{getTaskCallbackNames}} and the reference.
|
| - |
|
79 |
}
|
| - |
|
80 |
\references{
|
| - |
|
81 |
Duncan Temple Lang (2001)
|
| - |
|
82 |
\emph{Top-level Task Callbacks in R}, % TaskHandlers.tex is in R-dev-web svn
|
| 79 |
\url{https://developer.r-project.org/TaskHandlers.pdf}
|
83 |
\url{https://developer.r-project.org/TaskHandlers.pdf}
|
| 80 |
}
|
84 |
}
|
| 81 |
\examples{
|
85 |
\examples{
|
| 82 |
# create the manager
|
86 |
# create the manager
|
| 83 |
h <- taskCallbackManager()
|
87 |
h <- taskCallbackManager()
|
| Line 92... |
Line 96... |
| 92 |
getTaskCallbackNames()
|
96 |
getTaskCallbackNames()
|
| 93 |
|
97 |
|
| 94 |
# look at the R-level callbacks
|
98 |
# look at the R-level callbacks
|
| 95 |
names(h$callbacks())
|
99 |
names(h$callbacks())
|
| 96 |
|
100 |
|
| 97 |
getTaskCallbackNames()
|
- |
|
| 98 |
removeTaskCallback("R-taskCallbackManager")
|
101 |
removeTaskCallback("R-taskCallbackManager")
|
| 99 |
}
|
102 |
}
|
| 100 |
\keyword{environment}
|
103 |
\keyword{environment}
|