/// <summary> /// Construct my default state. /// </summary> /// <param name="stage">This <see cref="Stage"/> of actors I create</param> /// <param name="exchangeName">The name of the exchange I feed</param> /// <param name="feederType">The type of the <see cref="IFeeder"/></param> /// <param name="entryReaderType">The <see cref="IEntryReader"/> used by the <see cref="IFeeder"/></param> internal DefaultFeed(Stage stage, string exchangeName, Type feederType, IEntryReader entryReaderType) { _exchangeName = exchangeName; _feederType = feederType; _entryReaderType = entryReaderType; _feeder = stage.ActorFor <IFeeder>(feederType, this, entryReaderType); }
public static async Task <string> ReadStringAsync(this IEntryReader entry, Encoding encoding) { using (var stream = entry.Open()) { var bytes = await stream.ToArrayAsync(); return(encoding.GetString(bytes)); } }
public EntryCreator(IEntryReader reader, string databaseName, string collectionName) { ObjectReader = reader; var client = new MongoDB.Driver.MongoClient(); var database = client.GetDatabase(databaseName); Documents = database.GetCollection <BsonDocument>(collectionName); //Could just say, every collection is called Objects! //BUT, should define it in the Unity container! }
public AutoConsumerReader( IAutoMessageConsumer autoConsumer, IEntryReader objectReader, IMessagePublisher messagePublisher) { autoConsumer.MessageReceived += OnMessageReceived; _autoConsumer = autoConsumer; _objectReader = objectReader; _messagePublisher = messagePublisher; }
public EntryBroker( IEntryCreator creator, IEntryReader reader, IEntryUpdater updater, IEntryDeleter deleter) { _creator = creator; _reader = reader; _updater = updater; _deleter = deleter; }
/// <summary> /// Gets a new <see cref="Feed"/> with the given properties. /// </summary> /// <param name="stage">The <see cref="Stage"/> used to create this feeder</param> /// <param name="exchangeName">The name of this exchange</param> /// <param name="feederType">The <see cref="Actor"/> type of this feeder</param> /// <param name="entryReaderType">The <see cref="IEntryReader"/> that this feeder uses</param> /// <returns><see cref="Feed"/></returns> public static Feed DefaultFeedWith(Stage stage, string exchangeName, Type feederType, IEntryReader entryReaderType) => new DefaultFeed(stage, exchangeName, feederType, entryReaderType);
/// <summary> /// Construct my default state. /// </summary> /// <param name="feed">The <see cref="Feed"/> that is served</param> /// <param name="entryReader">The <see cref="IEntryReader"/> from which content is read</param> public TextEntryReaderFeeder(Feed feed, IEntryReader entryReader) { _feed = feed; _entryReader = entryReader; }
public static async Task <string> GetSHA512Async(this IEntryReader entry) { using (var stream = entry.Open()) { return(await stream.GetSHA512Async()); } }
public static string GetSHA512(this IEntryReader entry) { using (var stream = entry.Open()) { return(stream.GetSHA512()); } }