public static Func <TimeSpan?, TimeSpan> ToFunc(this GetTimeToKeep timeToKeep) { if (timeToKeep == null) { return(null); } return(x => timeToKeep(x)); }
public void Add <T>(Func <Task <T> > streamFactory, GetTimeToKeep timeToKeep = null, Action cleanup = null) where T : Stream { Guard.AgainstNull(streamFactory, nameof(streamFactory)); Streams.Add("", new OutgoingStream { AsyncStreamFactory = async() => await streamFactory().ConfigureAwait(false), TimeToKeep = timeToKeep, Cleanup = cleanup }); }
public void AddBytes(byte[] bytes, GetTimeToKeep timeToKeep = null, Action cleanup = null) { Guard.AgainstNull(bytes, nameof(bytes)); Streams.Add("", new OutgoingStream { BytesInstance = bytes, TimeToKeep = timeToKeep, Cleanup = cleanup }); }
public SendRegistration(IPersister persister, GetTimeToKeep timeToKeep) : base( stepId: $"{AssemblyHelper.Name}Send", behavior: typeof(SendBehavior), description: "Saves the payload into the shared location", factoryMethod: builder => new SendBehavior(persister, timeToKeep)) { InsertAfter("MutateOutgoingMessages"); InsertBefore("ApplyTimeToBeReceived"); }
public void AddBytes(Func <byte[]> bytesFactory, GetTimeToKeep timeToKeep = null, Action cleanup = null) { Guard.AgainstNull(bytesFactory, nameof(bytesFactory)); Streams.Add("", new OutgoingStream { BytesFactory = bytesFactory, TimeToKeep = timeToKeep, Cleanup = cleanup }); }
public void Add(Stream stream, GetTimeToKeep timeToKeep = null, Action cleanup = null) { Guard.AgainstNull(stream, nameof(stream)); Streams.Add("", new OutgoingStream { StreamInstance = stream, TimeToKeep = timeToKeep, Cleanup = cleanup }); }
public void Add(Func <Stream> streamFactory, GetTimeToKeep timeToKeep = null, Action cleanup = null) { Guard.AgainstNull(streamFactory, nameof(streamFactory)); Streams.Add("", new OutgoingStream { StreamFactory = streamFactory, TimeToKeep = timeToKeep, Cleanup = cleanup }); }
public void Add(string name, Stream stream, GetTimeToKeep timeToKeep = null, Action cleanup = null, IReadOnlyDictionary <string, string> metadata = null) { Guard.AgainstNull(name, nameof(name)); Guard.AgainstNull(stream, nameof(stream)); Inner.Add(name, new Outgoing { StreamInstance = stream, TimeToKeep = timeToKeep, Cleanup = cleanup.WrapCleanupInCheck(name), Metadata = metadata }); }
public void AddBytes(string name, Func <byte[]> bytesFactory, GetTimeToKeep timeToKeep = null, Action cleanup = null, IReadOnlyDictionary <string, string> metadata = null) { Guard.AgainstNull(name, nameof(name)); Guard.AgainstNull(bytesFactory, nameof(bytesFactory)); Inner.Add(name, new Outgoing { BytesFactory = bytesFactory.WrapFuncInCheck(name), TimeToKeep = timeToKeep, Cleanup = cleanup.WrapCleanupInCheck(name), Metadata = metadata }); }
public void AddBytes(string name, byte[] bytes, GetTimeToKeep timeToKeep = null, Action cleanup = null, IReadOnlyDictionary <string, string> metadata = null) { Guard.AgainstNull(name, nameof(name)); Guard.AgainstNull(bytes, nameof(bytes)); Inner.Add(name, new Outgoing { BytesInstance = bytes, TimeToKeep = timeToKeep, Cleanup = cleanup.WrapCleanupInCheck(name), Metadata = metadata }); }
/// <summary> /// Enable SQL attachments for this endpoint. /// </summary> public static AttachmentSettings EnableAttachments( this EndpointConfiguration configuration, string connection, GetTimeToKeep timeToKeep) { Guard.AgainstNull(configuration, nameof(configuration)); Guard.AgainstNull(timeToKeep, nameof(timeToKeep)); Guard.AgainstNullOrEmpty(connection, nameof(connection)); var settings = configuration.GetSettings(); var attachments = new AttachmentSettings(() => OpenConnection(connection), timeToKeep); return(SetAttachments(configuration, settings, attachments)); }
/// <summary> /// Enable SQL attachments for this endpoint. /// </summary> public static AttachmentSettings EnableAttachments( this EndpointConfiguration configuration, Func <Task <SqlConnection> > connectionFactory, GetTimeToKeep timeToKeep) { Guard.AgainstNull(configuration, nameof(configuration)); Guard.AgainstNull(timeToKeep, nameof(timeToKeep)); Guard.AgainstNull(connectionFactory, nameof(connectionFactory)); var settings = configuration.GetSettings(); var attachments = new AttachmentSettings(connectionFactory, timeToKeep); return(SetAttachments(configuration, settings, attachments)); }
public void Add <T>(string name, Func <Task <T> > streamFactory, GetTimeToKeep timeToKeep = null, Action cleanup = null, IReadOnlyDictionary <string, string> metadata = null) where T : Stream { Guard.AgainstNull(name, nameof(name)); Guard.AgainstNull(streamFactory, nameof(streamFactory)); Inner.Add(name, new Outgoing { AsyncStreamFactory = streamFactory.WrapStreamFuncTaskInCheck(name), TimeToKeep = timeToKeep, Cleanup = cleanup.WrapCleanupInCheck(name), Metadata = metadata }); }
/// <summary> /// Enable SQL attachments for this endpoint. /// </summary> public static AttachmentSettings EnableAttachments( this EndpointConfiguration configuration, Func <Task <SqlConnection> > connectionFactory, GetTimeToKeep timeToKeep) { Guard.AgainstNull(configuration, nameof(configuration)); Guard.AgainstNull(timeToKeep, nameof(timeToKeep)); Guard.AgainstNull(connectionFactory, nameof(connectionFactory)); var settings = configuration.GetSettings(); var attachments = new AttachmentSettings(connectionFactory, timeToKeep); settings.Set <AttachmentSettings>(attachments); configuration.EnableFeature <AttachmentFeature>(); configuration.DisableFeature <AttachmentsUsedWhenNotEnabledFeature>(); return(attachments); }
/// <summary> /// Enable SQL attachments for this endpoint. /// </summary> public static AttachmentSettings EnableAttachments( this EndpointConfiguration configuration, string fileShare, GetTimeToKeep timeToKeep) { Guard.AgainstNull(configuration, nameof(configuration)); Guard.AgainstNull(timeToKeep, nameof(timeToKeep)); Guard.AgainstNullOrEmpty(fileShare, nameof(fileShare)); var settings = configuration.GetSettings(); var attachments = new AttachmentSettings(fileShare, timeToKeep); settings.Set(attachments); configuration.EnableFeature <AttachmentFeature>(); configuration.DisableFeature <AttachmentsUsedWhenNotEnabledFeature>(); return(attachments); }
public SendBehavior(Func <Task <SqlConnection> > connectionFactory, IPersister persister, GetTimeToKeep timeToKeep) { this.connectionFactory = connectionFactory; this.persister = persister; endpointTimeToKeep = timeToKeep; }
internal AttachmentSettings(Func <Task <SqlConnection> > connectionFactory, GetTimeToKeep timeToKeep) { TimeToKeep = timeToKeep; ConnectionFactory = connectionFactory; }
public void AddBytes(byte[] bytes, GetTimeToKeep timeToKeep = null, Action cleanup = null, IReadOnlyDictionary <string, string> metadata = null) { AddBytes("default", bytes, timeToKeep, cleanup, metadata); }
internal AttachmentSettings(Func <Task <SqlConnection> > connectionFactory, GetTimeToKeep timeToKeep) { Guard.AgainstNull(connectionFactory, nameof(connectionFactory)); TimeToKeep = timeToKeep; ConnectionFactory = connectionFactory; }
public void Add(Stream stream, GetTimeToKeep timeToKeep = null, Action cleanup = null, IReadOnlyDictionary <string, string> metadata = null) { Add("default", stream, timeToKeep, cleanup, metadata); }
public void AddBytes(Func <Task <byte[]> > bytesFactory, GetTimeToKeep timeToKeep = null, Action cleanup = null, IReadOnlyDictionary <string, string> metadata = null) { AddBytes("default", bytesFactory, timeToKeep, cleanup, metadata); }
public void Add <T>(Func <Task <T> > streamFactory, GetTimeToKeep timeToKeep = null, Action cleanup = null, IReadOnlyDictionary <string, string> metadata = null) where T : Stream { Add("default", streamFactory, timeToKeep, cleanup, metadata); }
public SendBehavior(IPersister persister, GetTimeToKeep timeToKeep) { this.persister = persister; endpointTimeToKeep = timeToKeep; }
internal AttachmentSettings(string fileShare, GetTimeToKeep timeToKeep) { Guard.AgainstNullOrEmpty(fileShare, nameof(fileShare)); FileShare = fileShare; TimeToKeep = timeToKeep; }