Class Proxy<TServer>
- Namespace
- MarymoorStudios.Core.Rpc
- Assembly
- MarymoorStudios.Core.Rpc.dll
Abstract base class for all generated proxy types.
public abstract class Proxy<TServer> where TServer : AServer<TServer>
Type Parameters
TServer
The abstract server base class generated from the eventual interface.
- Inheritance
-
Proxy<TServer>
- Derived
- Inherited Members
Constructors
Proxy(Promise<TServer>)
Creates a forwarded promise whose outcome will be the same as p
.
protected Proxy(Promise<TServer> p)
Parameters
p
Promise<TServer>
Proxy(Resolver<TServer>)
Creates an unresolved promise whose future outcome is defined by r
.
protected Proxy(Resolver<TServer> r)
Parameters
r
Resolver<TServer>
Proxy(Proxy<TServer>)
Creates a forwarded promise whose outcome will be the same as p
.
protected Proxy(Proxy<TServer> p)
Parameters
p
Proxy<TServer>
Proxy(Exception)
Creates a failed promise whose outcome is ex
.
protected Proxy(Exception ex)
Parameters
ex
Exception
Proxy(TServer)
Creates a successfully resolved promise.
protected Proxy(TServer value)
Parameters
value
TServer
Properties
Failure
The error the promise failed with.
public Exception Failure { get; }
Property Value
Remarks
REQUIRES: the promise has failed.
IsFailed
True if the promise has failed.
public bool IsFailed { get; }
Property Value
IsResolved
True if the promise is in a resolved state (either success or failure).
public bool IsResolved { get; }
Property Value
Methods
AppendOne(ResolverTurn<TServer>)
Registers a message to be scheduled on server this proxy is resolved to.
public void AppendOne(ResolverTurn<TServer> msg)
Parameters
msg
ResolverTurn<TServer>The message to be scheduled.
Remarks
If this resolver is already resolved then msg
will be scheduled immediately.
GetRemoteIdentity()
Returns the identity of the remote peer of this proxy.
public Promise<UserIdentity?> GetRemoteIdentity()
Returns
Remarks
Returns the resolved identity of the first channel the proxy traverses, or
Sync()
Sends a synchronization request to target of this proxy.
public Promise Sync()
Returns
- Promise
Resolves successfully if and only if this proxy itself has resolved successfully end-to-end (possibly remotely), otherwise resolves to the same failure that the proxy resolved to.
Remarks
Sync() is often used to prove successful initialization before pipelining methods on a proxy. Sync() determines if a (possibly remote) computation that produced the proxy succeeded or failed. The proxy may later become aborted (particularly if it is remote) , but at the moment in time when the Sync() completed the proxy was successfully connected.