BackendFactory | R Documentation |
This class is a factory that provides concrete implementations of the
Backend
abstract class.
get()
Obtain a concrete implementation of the abstract Backend
class of the specified type.
BackendFactory$get(type)
type
A character string specifying the type of the
Backend
to instantiate. Possible values are "sync"
and
"async"
. See the Details section for more information.
When type = "sync"
a SyncBackend
instance is created
and returned. When type = "async"
an AsyncBackend
instance is provided instead.
A concrete implementation of the class Backend
. It
throws an error if the requested backend type
is not supported.
clone()
The objects of this class are cloneable with this method.
BackendFactory$clone(deep = FALSE)
deep
Whether to make a deep clone.
BackendService
, Backend
, SyncBackend
,
AsyncBackend
, and ContextFactory
.
# Create a backend factory.
backend_factory <- BackendFactory$new()
# Get a synchronous backend instance.
backend <- backend_factory$get("sync")
# Check the class of the backend instance.
class(backend)
# Get an asynchronous backend instance.
backend <- backend_factory$get("async")
# Check the class of the backend instance.
class(backend)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.