public static void Main()
{
var cfg = new IgniteConfiguration
{
SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
JvmOptions = new List<string> {"-Xms512m", "-Xmx1024m"}
};
using (var ignite = Ignition.Start(cfg))
{
Console.WriteLine(">>> Services example started.");
Console.WriteLine();
// Deploy a service
var svc = new MapService<int, string>();
Console.WriteLine(">>> Deploying service to all nodes...");
ignite.GetServices().DeployNodeSingleton("service", svc);
// Get a sticky service proxy so that we will always be contacting the same remote node.
var prx = ignite.GetServices().GetServiceProxy<IMapService<int, string>>("service", true);
for (var i = 0; i < 10; i++)
prx.Put(i, i.ToString());
var mapSize = prx.Size;
Console.WriteLine(">>> Map service size: " + mapSize);
ignite.GetServices().CancelAll();
}
Console.WriteLine();
Console.WriteLine(">>> Example finished, press any key to exit ...");
Console.ReadKey();
}
}