mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.4 KiB
50 lines
1.4 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using System;
|
|
using Orleans;
|
|
using Orleans.Runtime.Configuration;
|
|
using Squidex.Infrastructure;
|
|
|
|
namespace Squidex.Config.Orleans
|
|
{
|
|
public sealed class ClientWrapper : IInitializable, IDisposable
|
|
{
|
|
private readonly IClusterClient client;
|
|
|
|
public IClusterClient Client
|
|
{
|
|
get { return client; }
|
|
}
|
|
|
|
public ClientWrapper()
|
|
{
|
|
client = new ClientBuilder()
|
|
.UseConfiguration(ClientConfiguration.LocalhostSilo())
|
|
.UseDashboard()
|
|
.ConfigureApplicationParts(builder =>
|
|
{
|
|
builder.AddApplicationPart(SquidexInfrastructure.Assembly);
|
|
})
|
|
.UseStaticGatewayListProvider(options =>
|
|
{
|
|
options.Gateways.Add(new Uri("gwy.tcp://127.0.0.1:40000/0"));
|
|
})
|
|
.Build();
|
|
}
|
|
|
|
public void Initialize()
|
|
{
|
|
client.Connect().Wait();
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
client.Close().Wait();
|
|
}
|
|
}
|
|
}
|
|
|