Пример #1
0
        public PayloadStreamAssembler GetPayloadAssembler(Guid id)
        {
            if (!_activeAssemblers.TryGetValue(id, out var assembler))
            {
                // a new id has come in, start a new task to process it
                assembler = new PayloadStreamAssembler(this, id);
                if (!_activeAssemblers.TryAdd(id, assembler))
                {
                    // Don't need to dispose the assembler because it was never used
                    // Get the one that is in use
                    _activeAssemblers.TryGetValue(id, out assembler);
                }
            }

            return(assembler);
        }
Пример #2
0
 internal ContentStream(Guid id, PayloadStreamAssembler assembler)
 {
     Id         = id;
     _assembler = assembler ?? throw new ArgumentNullException();
     Stream     = _assembler.GetPayloadAsStream();
 }
Пример #3
0
 public PayloadStream(PayloadStreamAssembler assembler)
 {
     _assembler = assembler;
 }
Пример #4
0
 internal PayloadStream(PayloadStreamAssembler assembler)
 {
     _assembler = assembler;
 }