Skip to content

tauInterfaces

Christian Schladetsch edited this page Mar 31, 2023 · 3 revisions

Tau Interfaces

These are basically C#-style interfaces, such as:

namespace MyNamespace {
    interface Foo {
        string Name { get; set; }
        string Name2 { set; }
        string Name3 { get; }
        
        void Act();
        string Add(string a, string b);
    }
}

TauGenerator

The Generator can produce Proxy and/or Agent from this interface.

For example, from the above interface, TauGenerator produces the following:

Proxy

using Flow;

using Pyro;
using Pyro.Network;
using Void = Pyro.BuiltinTypes.Void;

namespace Pyro.Network.MyNamespaceProxy {
    public interface IFooProxy : IProxyBase {
        IFuture<string> Name { get; set; }
        IFuture<string> Name2 { set;  }
        IFuture<string> Name3 { get;  }
        IFuture<Void> Act();
        IFuture<string> Add(string a, string b);
    }
}

Agent

using Void = Pyro.BuiltinTypes.Void;

namespace Pyro.Network.MyNamespaceAgent {
    public interface IFooAgent : IAgentBase {
        string Name { get; set; }
        string Name2 { set;  }
        string Name3 { get;  }
        Void Act();
        string Add(string a, string b);
    }
}

Void

Note that void has to be handled specially. It cannot be used directly as a type argument to IFuture<T>, so we use Pyro.BuiltinTypes.Void for this. This allows the caller to still await when a call that returns nothing has been completed.

Todo

Not place Agents and Proxies in namespace Pyro.Network by default.

Clone this wiki locally