• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ProjectionManagementMessage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ProjectionManagementMessage的典型用法代码示例。如果您正苦于以下问题:C# ProjectionManagementMessage类的具体用法?C# ProjectionManagementMessage怎么用?C# ProjectionManagementMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProjectionManagementMessage类属于命名空间,在下文中一共展示了ProjectionManagementMessage类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ProjectionsStatisticsHttpFormatted

 public ProjectionsStatisticsHttpFormatted(
     ProjectionManagementMessage.Statistics source, Func<string, string> makeAbsouteUrl)
 {
     _projections =
         source.Projections.Select(v => new ProjectionStatisticsHttpFormatted(v, makeAbsouteUrl)).ToArray();
     _transactionFileHeadPosition = source.TransactionFileHeadPosition;
 }
开发者ID:vishal-h,项目名称:EventStore-1,代码行数:7,代码来源:ProjectionsStatisticsHttpFormatted.cs


示例2: Definition

 public Definition(
     string name, string handlerType, string query, SlaveProjectionRequestedNumber requestedNumber,
     ProjectionMode mode, bool emitEnabled, bool checkpointsEnabled, bool enableRunAs,
     ProjectionManagementMessage.RunAs runAs)
 {
     _name = name;
     _handlerType = handlerType;
     _query = query;
     _requestedNumber = requestedNumber;
     _runAs = runAs;
     _enableRunAs = enableRunAs;
     _checkpointsEnabled = checkpointsEnabled;
     _emitEnabled = emitEnabled;
     _mode = mode;
 }
开发者ID:jjoergensen,项目名称:EventStore,代码行数:15,代码来源:SlaveProjectionDefinitions.cs


示例3: Handle

 public void Handle(ProjectionManagementMessage.Command.Abort message)
 {
     _lastAccessed = _timeProvider.Now;
     UpdateProjectionVersion();
     SetLastReplyEnvelope(message.Envelope);
     Disable();
     Abort();
 }
开发者ID:EventStore,项目名称:EventStore,代码行数:8,代码来源:ManagedProjection.cs


示例4: DoDisable

 private void DoDisable(ProjectionManagementMessage.Disable message)
 {
     if (!Enabled)
     {
         message.Envelope.ReplyWith(new ProjectionManagementMessage.OperationFailed("Not enabled"));
         return;
     }
     Disable();
     PrepareAndBeginWrite(
         forcePrepare: false,
         completed: () => message.Envelope.ReplyWith(new ProjectionManagementMessage.Updated(message.Name)));
 }
开发者ID:robashton,项目名称:EventStore,代码行数:12,代码来源:ManagedProjection.cs


示例5: InitializeNew

 public void InitializeNew(ProjectionManagementMessage.Post message, Action completed)
 {
     LoadPersistedState(
         new PersistedState
             {
                 Enabled = message.Enabled,
                 HandlerType = message.HandlerType,
                 Query = message.Query,
                 Mode = message.Mode
             });
     PrepareAndBeginWrite(forcePrepare: true, completed: () => StartNew(completed));
 }
开发者ID:robashton,项目名称:EventStore,代码行数:12,代码来源:ManagedProjection.cs


示例6: Handle

 public void Handle(ProjectionManagementMessage.Enable message)
 {
     if (Enabled)
     {
         message.Envelope.ReplyWith(new ProjectionManagementMessage.OperationFailed("Not disabled"));
         return;
     }
     Enable();
     PrepareAndBeginWrite(
         forcePrepare: true,
         completed:
             () =>
             Start(
                 () => message.Envelope.ReplyWith(new ProjectionManagementMessage.Updated(message.Name))));
 }
开发者ID:robashton,项目名称:EventStore,代码行数:15,代码来源:ManagedProjection.cs


示例7: DoDelete

 private void DoDelete(ProjectionManagementMessage.Delete message)
 {
     if (Enabled)
         Disable();
     Delete();
     Action completed = () =>
         {
             message.Envelope.ReplyWith(new ProjectionManagementMessage.Updated(_name));
             DisposeCoreProjection();
             _output.Publish(new ProjectionManagementMessage.Internal.Deleted(_name, Id));
         };
     UpdateProjectionVersion();
     if (Enabled)
         Prepare(() => BeginWrite(completed));
     else
         BeginWrite(completed);
 }
开发者ID:jjoergensen,项目名称:EventStore,代码行数:17,代码来源:ManagedProjection.cs


示例8: UpdateQuery

 private void UpdateQuery(ProjectionManagementMessage.Command.UpdateQuery message)
 {
     PersistedProjectionState.HandlerType = message.HandlerType ?? HandlerType;
     PersistedProjectionState.Query = message.Query;
     PersistedProjectionState.EmitEnabled = message.EmitEnabled ?? PersistedProjectionState.EmitEnabled;
     _pendingWritePersistedState = true;
     if (_state == ManagedProjectionState.Completed)
     {
         Reset();
     }
 }
开发者ID:EventStore,项目名称:EventStore,代码行数:11,代码来源:ManagedProjection.cs


示例9: SetRunAs

 private void SetRunAs(ProjectionManagementMessage.Command.SetRunAs message)
 {
     PersistedProjectionState.RunAs = message.Action == ProjectionManagementMessage.Command.SetRunAs.SetRemove.Set
         ? SerializedRunAs.SerializePrincipal(message.RunAs)
         : null;
     _runAs = SerializedRunAs.DeserializePrincipal(PersistedProjectionState.RunAs);
     _pendingWritePersistedState = true;
 }
开发者ID:EventStore,项目名称:EventStore,代码行数:8,代码来源:ManagedProjection.cs


示例10: SerializePrincipal

        public static SerializedRunAs SerializePrincipal(ProjectionManagementMessage.RunAs runAs)
        {
            if (runAs.Principal == null)
                return null; // anonymous
            if (runAs.Principal == SystemAccount.Principal)
                return new SerializedRunAs {Name = "$system"};

            var genericPrincipal = runAs.Principal as OpenGenericPrincipal;
            if (genericPrincipal == null)
                throw new ArgumentException(
                    "OpenGenericPrincipal is the only supported principal type in projections", "runAs");
            return new SerializedRunAs {Name = runAs.Principal.Identity.Name, Roles = genericPrincipal.Roles};
        }
开发者ID:jjoergensen,项目名称:EventStore,代码行数:13,代码来源:ManagedProjection.cs


示例11: DoUpdateQuery

 private void DoUpdateQuery(ProjectionManagementMessage.UpdateQuery message)
 {
     _persistedState.HandlerType = message.HandlerType ?? HandlerType;
     _persistedState.Query = message.Query;
     _persistedState.EmitEnabled = message.EmitEnabled ?? _persistedState.EmitEnabled;
     if (_state == ManagedProjectionState.Completed)
     {
         ResetProjection();
     }
     Action completed = () =>
         {
             StartOrLoadStopped(() => { });
             message.Envelope.ReplyWith(new ProjectionManagementMessage.Updated(message.Name));
         };
     UpdateProjectionVersion();
     Prepare(() => BeginWrite(completed));
 }
开发者ID:jjoergensen,项目名称:EventStore,代码行数:17,代码来源:ManagedProjection.cs


示例12: Handle

        public void Handle(ProjectionManagementMessage.GetQuery message)
        {
            _lastAccessed = _timeProvider.Now;
            if (!ProjectionManagementMessage.RunAs.ValidateRunAs(Mode, ReadWrite.Read, _runAs, message)) return;

            var emitEnabled = _persistedState.EmitEnabled ?? false;
            message.Envelope.ReplyWith(
                new ProjectionManagementMessage.ProjectionQuery(_name, Query, emitEnabled, _persistedState.SourceDefinition));
        }
开发者ID:jjoergensen,项目名称:EventStore,代码行数:9,代码来源:ManagedProjection.cs


示例13: DoDelete

 private void DoDelete(ProjectionManagementMessage.Delete message)
 {
     if (Enabled)
         Disable();
     Delete();
     PrepareAndBeginWrite(
         forcePrepare: false,
         completed: () => message.Envelope.ReplyWith(new ProjectionManagementMessage.Updated(message.Name)));
 }
开发者ID:robashton,项目名称:EventStore,代码行数:9,代码来源:ManagedProjection.cs


示例14: DoUpdateQuery

 private void DoUpdateQuery(ProjectionManagementMessage.UpdateQuery message)
 {
     UpdateQuery(message.HandlerType ?? HandlerType, message.Query);
     PrepareAndBeginWrite(
         forcePrepare: true, completed: () =>
             {
                 if (Enabled)
                     Start(() => { });
                 message.Envelope.ReplyWith(new ProjectionManagementMessage.Updated(message.Name));
             });
 }
开发者ID:robashton,项目名称:EventStore,代码行数:11,代码来源:ManagedProjection.cs



注:本文中的ProjectionManagementMessage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Promise类代码示例发布时间:2022-05-24
下一篇:
C# ProjectionInfo类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap