Interface IRemoteServiceBroker
- Namespace
- Nerdbank.JsonRpc.BrokeredServices
- Assembly
- Nerdbank.JsonRpc.dll
Exposes discovery and service-channel allocation over RPC.
[GenerateShape(IncludeMethods = MethodShapeFlags.PublicInstance)]
public interface IRemoteServiceBroker : IShapeable<IRemoteServiceBroker>
- Inherited Members
Methods
CancelServiceRequestAsync(Guid, CancellationToken)
Releases an endpoint that the caller cannot or will not connect to.
Task CancelServiceRequestAsync(Guid requestId, CancellationToken cancellationToken = default)
Parameters
requestIdGuidThe allocated request identity.
cancellationTokenCancellationTokenCancels the operation.
Returns
- Task
A task tracking cleanup.
GetCapabilitiesAsync(ServiceMoniker, CancellationToken)
Queries registration capabilities without activating a service.
Task<IReadOnlyList<string>?> GetCapabilitiesAsync(ServiceMoniker moniker, CancellationToken cancellationToken = default)
Parameters
monikerServiceMonikerThe requested service.
cancellationTokenCancellationTokenCancels discovery.
Returns
- Task<IReadOnlyList<string>>
Stable capability identifiers, or null when unavailable.
HandshakeAsync(RemoteServiceConnections, CancellationToken)
Negotiates a broker protocol version and service-channel transport.
Task<int> HandshakeAsync(RemoteServiceConnections connections, CancellationToken cancellationToken = default)
Parameters
connectionsRemoteServiceConnectionsThe client's supported transports.
cancellationTokenCancellationTokenCancels negotiation.
Returns
RequestServiceChannelAsync(ServiceMoniker, RemoteServiceActivationOptions, CancellationToken)
Allocates a service endpoint and returns its registration's actual capabilities.
Task<RemoteServiceConnectionInfo?> RequestServiceChannelAsync(ServiceMoniker moniker, RemoteServiceActivationOptions options = default, CancellationToken cancellationToken = default)
Parameters
monikerServiceMonikerThe requested service.
optionsRemoteServiceActivationOptionsTransferable activation arguments and cultures.
cancellationTokenCancellationTokenCancels allocation.
Returns
- Task<RemoteServiceConnectionInfo>
The connection instructions, or null if unavailable.
Events
AvailabilityChanged
Occurs when queried services may have changed.
event EventHandler<BrokeredServicesChangedEventArgs> AvailabilityChanged