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 struct FromAsyncTaskResult{ | |
| public int result; | |
| }; | |
| void Main(){ | |
| MainNew().GetAwaiter().GetResult(); | |
| } | |
| async Task<FromAsyncTaskResult[]> MainNew() | |
| { |
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 ProducerConsumerQueue : IDisposable | |
| { | |
| /// <summary> | |
| /// thread blocking collection | |
| /// </summary> | |
| BlockingCollection<WorkItem> taskCollection = new BlockingCollection<WorkItem>(); | |
| /// <summary> | |
| /// task continuations and |
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
| /* Reactive Cloud Queue */ | |
| namespace AzureTrader.Messaging | |
| { | |
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; |
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
| async Task Main() | |
| { | |
| using (var q = new CommandsPipeline(2)) | |
| { | |
| await Task.Run(()=> { | |
| var queue = q; | |
| Parallel.ForEach(string.Format("StringParallelQuery"), | |
| new ParallelOptions { |
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
| <?xml version="1.0" encoding="utf-8" ?> | |
| <Weavers> | |
| <Costura> | |
| <CreateTemporaryAssemblies> | |
| True | |
| </CreateTemporaryAssemblies> | |
| <ExcludeAssemblies> | |
| System | |
| System.Core | |
| </ExcludeAssemblies> |
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
| void Main() | |
| { | |
| using(var kernel = new StandardKernel()) | |
| { | |
| kernel.Bind<Foo>().ToSelf(); | |
| kernel.Bind<IBarFactory>().To<BarFactory>(); | |
| kernel.Bind<Bar>().ToSelf(); | |
| kernel.Get<Foo>().Do(1,2); |
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.Reflection; | |
| using System.Linq.Expressions; | |
| using System.Collections; | |
| using System.Linq; | |
| public class Program | |
| { | |
| public static void Main() | |
| { |
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.Threading.Tasks; | |
| namespace AsyncReadWritePipeline | |
| { | |
| public class Program | |
| { | |
| public class ProducerConsumerHub<T> | |
| { | |
| TaskCompletionSource<Empty> _consumer = new TaskCompletionSource<Empty>(); |
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 GenericMsmqProcessing.Core.MessageHandler; | |
| using GenericMsmqProcessing.Core.Queue; | |
| using log4net; | |
| namespace GenericMsmqProcessing.Core.MessageProccessor |
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
| member x.ToMsmqQueuePath() = | |
| match x with | |
| | LocalName(hostName, queueName)-> (sprintf @".\private$\%s" queueName) | |
| | IPAddress(hostName, queueName)-> (sprintf @"FormatName:DIRECT=TCP:%s\private$\%s" hostName queueName) | |
| | Multicast(hostName, port)-> (sprintf @"FormatName:MULTICAST=%s:%i" hostName port) | |
| | MachineId(hostName, queueName)-> (sprintf @"FormatName:PRIVATE=%s\%s" hostName queueName) | |
| | _-> (sprintf @"FormatName:DIRECT=OS:%s\private$\%s" x.Host(getQueueName x)) |