mirror of
https://github.com/fluencelabs/aqua-lib
synced 2024-12-04 07:10:24 +00:00
This reverts commit cce6da5f42
.
This commit is contained in:
parent
cce6da5f42
commit
658d63472c
32
workers.aqua
32
workers.aqua
@ -1,19 +1,41 @@
|
||||
import PeerId from "./builtin.aqua"
|
||||
|
||||
-- Available only on rust peers
|
||||
service Worker("worker"):
|
||||
service DealWorker("worker"):
|
||||
-- Creates new worker associated with `deal_id`.
|
||||
-- Throws an error if worker exists.
|
||||
create(deal_id: string) -> PeerId
|
||||
create(deal_id: ?string) -> PeerId
|
||||
|
||||
-- Returns worker peer id associated with `deal_id`.
|
||||
-- Throws an error if worker doesn't exist.
|
||||
get_peer_id(deal_id: ?string) -> PeerId
|
||||
|
||||
-- Returns worker peer id associated with `deal_id`.
|
||||
-- Returns nil if worker doesn't exist.
|
||||
get_worker_id(deal_id: string) -> ?PeerId
|
||||
get_worker_id(deal_id: ?string) -> ?PeerId
|
||||
|
||||
-- Removes worker with all deployed spells and services.
|
||||
-- Throws an error if worker doesn't exist.
|
||||
-- Worker can be removed only by worker creator or worker itself.
|
||||
remove(worker_id: PeerId)
|
||||
|
||||
-- Returns list of all workers.
|
||||
list() -> []PeerId
|
||||
-- Available only on rust peers
|
||||
-- Suitable for direct hosting
|
||||
service Worker("worker"):
|
||||
-- Creates new worker associated with `init_peer_id`.
|
||||
-- Throws an error if worker exists.
|
||||
create() -> PeerId
|
||||
|
||||
-- Returns worker peer id associated with `init_peer_id`.
|
||||
-- Throws an error if worker doesn't exist.
|
||||
-- WILL BE DEPRECATED SOON, use `get_worker_id` instead.
|
||||
get_peer_id() -> PeerId
|
||||
|
||||
-- Returns worker peer id associated with `init_peer_id`.
|
||||
-- Returns nil if worker doesn't exist.
|
||||
get_worker_id() -> ?PeerId
|
||||
|
||||
-- Removes worker with all deployed spells and services.
|
||||
-- Throws an error if worker doesn't exist.
|
||||
-- Worker can be removed only by worker creator or worker itself.
|
||||
remove(worker_id: PeerId)
|
||||
|
Loading…
Reference in New Issue
Block a user