feat(workers): add Worker.get_worker_id [NET-523] (#51)

This commit is contained in:
Aleksey Proshutisnkiy 2023-08-31 11:57:17 +03:00 committed by GitHub
parent c47dd03e8c
commit 8447625cfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,10 @@ service DealWorker("worker"):
-- Throws an error if worker doesn't exist. -- Throws an error if worker doesn't exist.
get_peer_id(deal_id: ?string) -> PeerId get_peer_id(deal_id: ?string) -> PeerId
-- Returns worker peer id associated with `deal_id`.
-- Returns nil if worker doesn't exist.
get_peer_id_opt(deal_id: ?string) -> PeerId
-- Removes worker with all deployed spells and services. -- Removes worker with all deployed spells and services.
-- Throws an error if worker doesn't exist. -- Throws an error if worker doesn't exist.
-- Worker can be removed only by worker creator or worker itself. -- Worker can be removed only by worker creator or worker itself.
@ -24,8 +28,13 @@ service Worker("worker"):
-- Returns worker peer id associated with `init_peer_id`. -- Returns worker peer id associated with `init_peer_id`.
-- Throws an error if worker doesn't exist. -- Throws an error if worker doesn't exist.
-- WILL BE DEPRECATED SOON, use `get_worker_id` instead.
get_peer_id() -> PeerId 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. -- Removes worker with all deployed spells and services.
-- Throws an error if worker doesn't exist. -- Throws an error if worker doesn't exist.
-- Worker can be removed only by worker creator or worker itself. -- Worker can be removed only by worker creator or worker itself.