public static FileTapeContainer CreateTape(this FileStorageConfig config) { var factory = new FileTapeContainer(config.FullPath); factory.InitializeForWriting(); return(factory); }
public static FileAppendOnlyStore CreateAppendOnlyStore(this FileStorageConfig cfg, string name) { var store = new FileAppendOnlyStore(new DirectoryInfo(Path.Combine(cfg.FullPath, name))); store.Initialize(); return(store); }
public static IStreamingRoot CreateStreaming(this FileStorageConfig config) { var path = config.FullPath; var container = new FileStreamingContainer(path); container.Create(); return(container); }
public static FileTapeStorageFactory CreateTape(this FileStorageConfig config, string subfolder = "tapes") { var path = Path.Combine(config.FullPath, subfolder); var factory = new FileTapeStorageFactory(path); factory.InitializeForWriting(); return(factory); }
public static NuclearStorage CreateNuclear(this FileStorageConfig self, Action <DefaultAtomicStorageStrategyBuilder> config) { var strategyBuilder = new DefaultAtomicStorageStrategyBuilder(); config(strategyBuilder); var strategy = strategyBuilder.Build(); return(CreateNuclear(self, strategy)); }
static Action<ImmutableEnvelope> BuildRouter(FileStorageConfig storage, IEnvelopeStreamer streamer) { return envelope => { var target = (envelope.DeliverOnUtc < DateTime.UtcNow ? "process" : "timer"); Console.WriteLine("Routed to " + target); storage.CreateQueueWriter(target).PutMessage(streamer.SaveEnvelopeData(envelope)); }; }
public static FilePartitionInbox CreateInbox(this FileStorageConfig cfg, string name, Func <uint, TimeSpan> decay = null) { var reader = new StatelessFileQueueReader(Path.Combine(cfg.FullPath, name), name); var waiter = decay ?? DecayEvil.BuildExponentialDecay(250); var inbox = new FilePartitionInbox(new[] { reader, }, waiter); inbox.Init(); return(inbox); }
public static FileStorageConfig CreateConfig(string fullPath, string optionalName = null, bool reset = false) { var folder = new DirectoryInfo(fullPath); var config = new FileStorageConfig(folder, optionalName ?? folder.Name); if (reset) { config.Reset(); } return config; }
public static FileQueueWriter CreateQueueWriter(this FileStorageConfig cfg, string queueName) { var full = Path.Combine(cfg.Folder.FullName, queueName); if (!Directory.Exists(full)) { Directory.CreateDirectory(full); } return (new FileQueueWriter(new DirectoryInfo(full), queueName)); }
public static FileStorageConfig CreateConfig(string fullPath, string optionalName = null, bool reset = false) { var folder = new DirectoryInfo(fullPath); var config = new FileStorageConfig(folder, optionalName ?? folder.Name); if (reset) { config.Reset(); } return(config); }
public void Setup() { var tmpPath = Path.GetTempPath(); _configPath = Path.Combine(tmpPath, "lokad-cqrs-test", Guid.NewGuid().ToString()); _config = new FileStorageConfig(new DirectoryInfo(_configPath), "testaccount"); }
static Bootstrapper() { var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "app_data"); var storageDirectory = new DirectoryInfo(path); storageConfig = new FileStorageConfig(storageDirectory, "simplecqrs"); }
public static NuclearStorage CreateNuclear(this FileStorageConfig config, IDocumentStrategy strategy) { var factory = new FileDocumentStore(config.FullPath, strategy); return(new NuclearStorage(factory)); }
public static IStreamingContainer CreateStreaming(this FileStorageConfig config, string subfolder) { return(config.CreateStreaming(subfolder).Create()); }
public static NuclearStorage CreateNuclear(this FileStorageConfig config) { return(CreateNuclear(config, builder => { })); }
public static IDocumentStore CreateDocumentStore(this FileStorageConfig config, IDocumentStrategy strategy) { return(new FileDocumentStore(config.FullPath, strategy)); }
public static NuclearStorage CreateNuclear(this FileStorageConfig config, IAtomicStorageStrategy strategy) { var factory = new FileAtomicStorageFactory(config.FullPath, strategy); return(new NuclearStorage(factory)); }
public static SimpleMessageSender CreateSimpleSender(this FileStorageConfig account, IEnvelopeStreamer streamer, string queueName) { return(new SimpleMessageSender(streamer, CreateQueueWriter(account, queueName))); }
public static FileTapeContainer CreateTape(this FileStorageConfig config, string subfolder) { return(CreateTape(config.SubFolder(subfolder))); }