public void Handle(ProjectionManagementMessage.UpdateQuery message) { _lastAccessed = _timeProvider.Now; if (!ProjectionManagementMessage.RunAs.ValidateRunAs(Mode, ReadWrite.Write, _runAs, message)) { return; } Stop(() => DoUpdateQuery(message)); }
private void DoUpdateQuery(ProjectionManagementMessage.UpdateQuery message) { UpdateQuery(message.HandlerType ?? HandlerType, message.Query); BeginWrite( () => { StartIfEnabled(); message.Envelope.ReplyWith(new ProjectionManagementMessage.Updated(message.Name)); }); }
private void DoUpdateQuery(ProjectionManagementMessage.UpdateQuery message) { UpdateQuery(message.HandlerType ?? HandlerType, message.Query, message.EmitEnabled); Action completed = () => { StartOrLoadStopped(() => { }); message.Envelope.ReplyWith(new ProjectionManagementMessage.Updated(message.Name)); }; UpdateProjectionVersion(); Prepare(() => BeginWrite(completed)); }
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)); }); }
public void Handle(ProjectionManagementMessage.UpdateQuery message) { _logger.Info( "Updating '{0}' projection source to '{1}' (Requested type is: '{2}')", message.Name, message.Query, message.HandlerType); var projection = GetProjection(message.Name); if (projection == null) { message.Envelope.ReplyWith(new ProjectionManagementMessage.NotFound()); } else { projection.Handle(message); // update query text } }
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)); }
public void Handle(ProjectionManagementMessage.UpdateQuery message) { Stop(() => DoUpdateQuery(message)); }