-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathProgram.cs
27 lines (26 loc) · 984 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using System.Threading.Tasks;
using Infinispan.Hotrod.Core;
namespace Infinispan.Hotrod.Application
{
class Program
{
static async Task Main(string[] args)
{
var myKey = "myKey";
/// [Create a cluster object]
InfinispanDG dg = new InfinispanDG();
// Use a non-authenticated non-encrypted cluster;
dg.AddHost("127.0.0.1", 11222);
/// [Create a cluster object]
/// [Create a cache]
var cache = dg.NewCache<string, string>(new StringMarshaller(), new StringMarshaller(), "default");
/// [Create a cache]
/// [Application code]
await cache.Put(myKey, "some value");
string result = await cache.Get(myKey);
Console.WriteLine("Getting my entry with key {0} from the cache. Result value is: {1}", myKey, result);
/// [Application code]
}
}
}