angular_ts/worker
Types
pub opaque type WorkerConfig(receive)
pub type WorkerCredentials {
OmitCredentials
SameOriginCredentials
IncludeCredentials
}
Constructors
-
OmitCredentials -
SameOriginCredentials -
IncludeCredentials
pub type WorkerError =
namespace.WorkerError
pub type WorkerErrorCode =
namespace.WorkerErrorCode
pub type WorkerHandle(send, receive) =
namespace.WorkerHandle(send, receive)
pub type WorkerModelMessage(model) =
namespace.WorkerModelMessage(model)
pub type WorkerRequest(payload) =
namespace.WorkerRequest(payload)
pub opaque type WorkerRequestOptions
pub type WorkerResponse(result) =
namespace.WorkerResponse(result)
pub type WorkerService =
namespace.WorkerService
pub type WorkerStatus =
namespace.WorkerStatus
pub type WorkerType {
ModuleWorker
ClassicWorker
}
Constructors
-
ModuleWorker -
ClassicWorker
Values
pub fn classic(
config: WorkerConfig(receive),
) -> WorkerConfig(receive)
pub fn config() -> WorkerConfig(receive)
pub fn decode(
config: WorkerConfig(receive),
decoder: fn(dynamic.Dynamic, dynamic.Dynamic) -> receive,
) -> WorkerConfig(receive)
pub fn dispose(disposer: dynamic.Dynamic) -> Nil
pub fn max_restarts(
config: WorkerConfig(receive),
) -> option.Option(Int)
pub fn model(
handle: namespace.WorkerHandle(send, receive),
channel: String,
) -> dynamic.Dynamic
pub fn named(
config: WorkerConfig(receive),
name: String,
) -> WorkerConfig(receive)
pub fn on_error(
handle: namespace.WorkerHandle(send, receive),
listener: fn(namespace.WorkerError) -> Nil,
) -> dynamic.Dynamic
pub fn on_message(
handle: namespace.WorkerHandle(send, receive),
listener: fn(receive, dynamic.Dynamic) -> Nil,
) -> dynamic.Dynamic
pub fn post(
handle: namespace.WorkerHandle(send, receive),
message: send,
) -> Nil
pub fn request(
handle: namespace.WorkerHandle(send, receive),
message: send,
options: WorkerRequestOptions,
) -> dynamic.Dynamic
pub fn request_options() -> WorkerRequestOptions
pub fn restart(
handle: namespace.WorkerHandle(send, receive),
) -> Nil
pub fn restart_delay(
config: WorkerConfig(receive),
) -> option.Option(Int)
pub fn restart_enabled(config: WorkerConfig(receive)) -> Bool
pub fn start(
service: namespace.WorkerService,
script_path: String,
config: WorkerConfig(receive),
) -> namespace.WorkerHandle(send, receive)
pub fn terminate(
handle: namespace.WorkerHandle(send, receive),
) -> Nil
pub fn to_js_config(
config: WorkerConfig(receive),
) -> dynamic.Dynamic
pub fn to_js_request_options(
options: WorkerRequestOptions,
) -> dynamic.Dynamic
pub fn with_credentials(
config: WorkerConfig(receive),
credentials: WorkerCredentials,
) -> WorkerConfig(receive)
pub fn with_restart(
config: WorkerConfig(receive),
delay: Int,
max_restarts: Int,
) -> WorkerConfig(receive)
pub fn with_signal(
options: WorkerRequestOptions,
signal: dynamic.Dynamic,
) -> WorkerRequestOptions
pub fn with_timeout(
options: WorkerRequestOptions,
milliseconds: Int,
) -> WorkerRequestOptions
pub fn with_transfer(
options: WorkerRequestOptions,
transfer: dynamic.Dynamic,
) -> WorkerRequestOptions