From b24b95dc48d437b9ea5f096b20b079df30f1a16a Mon Sep 17 00:00:00 2001 From: Simon Etter Date: Tue, 25 Apr 2023 21:01:39 +0800 Subject: [PATCH] fix(agentforservice): require owner::Agent, not owner::AgentID --- src/container.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/container.jl b/src/container.jl index 2089a66..2aa040c 100644 --- a/src/container.jl +++ b/src/container.jl @@ -574,23 +574,23 @@ function deregister(c::Container, aid::AgentID, svc::String) end """ - agentforservice(c::Container, svc::String, owner::AgentID) + agentforservice(c::Container, svc::String, owner::Agent) Lookup any agent providing the service `svc`, and return an `AgentID` owned by `owner`. Returns `nothing` if no agent providing specified service found. """ -function agentforservice(c::StandaloneContainer, svc::String, owner::AgentID) +function agentforservice(c::StandaloneContainer, svc::String, owner::Agent) svc ∈ keys(c.services) || return nothing AgentID(first(c.services[svc]).name, false, owner) end """ - agentsforservice(c::Container, svc::String, owner::AgentID) + agentsforservice(c::Container, svc::String, owner::Agent) Lookup all agents providing the service `svc`, and return list of `AgentID` owned by `owner`. Returns an empty list if no agent providing specified service found. """ -function agentsforservice(c::StandaloneContainer, svc::String, owner::AgentID) +function agentsforservice(c::StandaloneContainer, svc::String, owner::Agent) svc ∈ keys(c.services) || return AgentID[] [AgentID(s.name, false, owner) for s ∈ c.services[svc]] end