@morojs/moro / ServiceRegistry
Class: ServiceRegistry
Defined in: src/core/networking/service-discovery.ts:22
Constructors
Constructor
new ServiceRegistry(
options
):ServiceRegistry
Defined in: src/core/networking/service-discovery.ts:27
Parameters
options
Returns
ServiceRegistry
Methods
deregister()
deregister(
serviceName
):Promise
<void
>
Defined in: src/core/networking/service-discovery.ts:63
Parameters
serviceName
string
Returns
Promise
<void
>
destroy()
destroy():
void
Defined in: src/core/networking/service-discovery.ts:279
Returns
void
discover()
discover(
serviceName
):Promise
<ServiceInfo
[]>
Defined in: src/core/networking/service-discovery.ts:50
Parameters
serviceName
string
Returns
Promise
<ServiceInfo
[]>
getAllServices()
getAllServices():
Record
<string
,ServiceInfo
[]>
Defined in: src/core/networking/service-discovery.ts:286
Returns
Record
<string
, ServiceInfo
[]>
register()
register(
service
):Promise
<void
>
Defined in: src/core/networking/service-discovery.ts:32
Parameters
service
Returns
Promise
<void
>
selectService()
selectService(
serviceName
,strategy
):null
|ServiceInfo
Defined in: src/core/networking/service-discovery.ts:254
Parameters
serviceName
string
strategy
"round-robin"
| "random"
| "least-connections"
Returns
null
| ServiceInfo