2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-26 21:13:13 +00:00

Static Calling

This commit is contained in:
2022-08-07 23:09:31 +03:00
parent 0dc457bf7e
commit af94ce318a
18 changed files with 784 additions and 259 deletions

View File

@ -57,7 +57,14 @@ namespace Test
// Create stores to keep objects.
var system = await Warehouse.Put("sys", new MemoryStore());
var server = await Warehouse.Put("sys/server", new DistributedServer());
var web = await Warehouse.Put("sys/web", new HTTPServer() { Port = 8888});
server.MapCall("Hello", (string msg, DateTime time, DistributedConnection sender) =>
{
Console.WriteLine(msg);
return "Hi " + DateTime.UtcNow;
});
var web = await Warehouse.Put("sys/web", new HTTPServer() { Port = 8088});
var service = await Warehouse.Put("sys/service", new MyService());
var res1 = await Warehouse.Put("sys/service/r1", new MyResource() { Description = "Testing 1", CategoryId = 10 });
@ -95,6 +102,9 @@ namespace Test
dynamic remote = await Warehouse.Get<IResource>("iip://localhost/sys/service");
var con = remote.Connection as DistributedConnection;
var pcall = await con.Call("Hello", "whats up ?", DateTime.UtcNow);
var template = await con.GetTemplateByClassName("Test.MyResource");