Skip to content

Commit

Permalink
fix(agentforservice): require owner::Agent, not owner::AgentID
Browse files Browse the repository at this point in the history
  • Loading branch information
ettersi committed Apr 26, 2023
1 parent f552493 commit b24b95d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/container.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b24b95d

Please sign in to comment.