Start() public method

public Start ( string args ) : void
args string
return void
Beispiel #1
0
        public static void Main(string[] args)
        {
            var typeNameSerializer = new TypeNameSerializer();
            var argParser = new ArgParser();
            var arguments = argParser.Parse(args);

            bool enableBinaryPayloads = false;
            arguments.WithTypedKeyOptional<bool>("b", a => enableBinaryPayloads = bool.Parse(a.Value))
                .FailWith(messsage("Invalid enable binary payloads (b) parameter"));

            IErrorMessageSerializer errorMessageSerializer;
            if (enableBinaryPayloads)
            {
                errorMessageSerializer = new Base64ErrorMessageSerializer();
            }
            else
            {
                errorMessageSerializer = new DefaultErrorMessageSerializer();
            }            

            // poor man's dependency injection FTW ;)            
            var program = new Program(
                argParser, 
                new QueueRetreival(errorMessageSerializer), 
                new FileMessageWriter(),
                new MessageReader(), 
                new QueueInsertion(errorMessageSerializer),
                new ErrorRetry(new JsonSerializer(typeNameSerializer), errorMessageSerializer),
                new Conventions(typeNameSerializer));
            program.Start(args);
        }
Beispiel #2
0
 public static void Main(string[] args)
 {
     // poor man's dependency injection FTW ;)
     var program = new Program(
         new ArgParser(),
         new QueueRetreival(),
         new FileMessageWriter(),
         new MessageReader(),
         new QueueInsertion(),
         new ErrorRetry(new JsonSerializer()));
     program.Start(args);
 }
Beispiel #3
0
        public static void Main(string[] args)
        {
            // poor man's dependency injection FTW ;)
            var program = new Program(
                new ArgParser(),
                new QueueRetreival(),
                new FileMessageWriter(),
                new MessageReader(),
                new QueueInsertion(),
                new ErrorRetry(new JsonSerializer()));

            program.Start(args);
        }