This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using RabbitMQ.Client; | |
using RabbitMQ.Client.Exceptions; | |
public class MessageQueueFactory : IMessageQueueFactory | |
{ | |
private readonly ConnectionFactory factory; | |
private IConnection connection; | |
public bool IsOpen | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using RabbitMQ.Client | |
public class CooperativeConsumer : IBasicConsumer | |
{ | |
private readonly IModel channel; | |
private readonly CooperativeQueue<IQueueMessage> queue; | |
public IModel Model | |
{ | |
get { return channel; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using StructureMap; | |
namespace Task.Services.Service | |
{ | |
public class Controller |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class CsvReader : IDisposable | |
{ | |
private const char DefaultFieldChar = ','; | |
private const char DefaultQuoteChar = '"'; | |
private const char DefaultEscapeChar = '\\'; | |
private readonly List<CsvLine> collection; | |
private readonly StringBuilder buffer; | |
private readonly Stream stream; | |
private readonly StreamReader reader; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CooperativeQueue<TMessage> | |
where TMessage : class, IQueueMessage | |
{ | |
private readonly Queue<TMessage> internalQueue; | |
private readonly ManualResetEventSlim manualReset; | |
private bool open; | |
public CooperativeQueue() | |
{ | |
internalQueue = new Queue<TMessage>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RedisCommand | |
{ | |
static byte[] GenerateCommand(byte[][] arguments) | |
{ | |
using (var stream = new MemoryStream()) | |
{ | |
var request = CreateIndicator('*', arguments.Length); | |
stream.Write(request, 0, request.Length); | |
stream.WriteNewLine(); |
NewerOlder