Inspirel banner

Programming Distributed Systems with YAMI4

4.3.25 .NET

Creating an agent object in C# with 5 dispatcher threads instead of default one can be achieved with the following code:

using Inspirel.YAMI;
// ...

{
    Parameters options = new Parameters();
    options.SetInteger(OptionNames.DISPATCHER_THREADS, 5);

    Agent myAgent = new Agent(options);
    // ...
}

The OptionNames class defines convenient string constants for all available configuration options.

Any subset of options can be used in a single parameters object and those options which are not provided are considered to have their default values.

No parameters object needs to be provided if all-default setup is intended, as shown in the following example:

using Inspirel.YAMI;
// ...

{
    Agent myAgent = new Agent();
    // ...
}

Agents should be properly closed, which is achieved with the Close() method call.