mirror of https://github.com/Squidex/squidex.git
6 changed files with 127 additions and 35 deletions
@ -0,0 +1,18 @@ |
|||||
|
// ==========================================================================
|
||||
|
// IRuleDequeuerGrain.cs
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex Group
|
||||
|
// All rights reserved.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using System.Threading.Tasks; |
||||
|
using Orleans; |
||||
|
|
||||
|
namespace Squidex.Domain.Apps.Read.Rules.Orleans.Grains |
||||
|
{ |
||||
|
public interface IRuleDequeuerGrain : IGrainWithStringKey |
||||
|
{ |
||||
|
Task ActivateAsync(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,32 @@ |
|||||
|
// ==========================================================================
|
||||
|
// RuleDequeuerBootstrap.cs
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex Group
|
||||
|
// All rights reserved.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using System.Threading.Tasks; |
||||
|
using Orleans.Providers; |
||||
|
using Squidex.Domain.Apps.Read.Rules.Orleans.Grains; |
||||
|
using Squidex.Infrastructure.Tasks; |
||||
|
|
||||
|
namespace Squidex.Domain.Apps.Read.Rules.Orleans |
||||
|
{ |
||||
|
public sealed class RuleDequeuerBootstrap : IBootstrapProvider |
||||
|
{ |
||||
|
public string Name { get; private set; } |
||||
|
|
||||
|
public Task Init(string name, IProviderRuntime providerRuntime, IProviderConfiguration config) |
||||
|
{ |
||||
|
var grain = providerRuntime.GrainFactory.GetGrain<IRuleDequeuerGrain>("Default"); |
||||
|
|
||||
|
return grain.ActivateAsync(); |
||||
|
} |
||||
|
|
||||
|
public Task Close() |
||||
|
{ |
||||
|
return TaskHelper.Done; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue