Beispiel #1
0
        public static void Main(string[] args)
        {
            // Set up default WebHook logger
            ILogger logger = new TraceLogger();

            // Set the WebHook Store we want to get WebHook subscriptions from. Azure store requires
            // a valid Azure Storage connection string named MS_AzureStoreConnectionString.
            IWebHookStore store = AzureWebHookStore.CreateStore(logger);

            // Set the sender we want to actually send out the WebHooks. We could also 
            // enqueue messages for scale out.
            IWebHookSender sender = new DataflowWebHookSender(logger);

            // Set up WebHook manager which we use for creating notifications.
            Manager = new WebHookManager(store, sender, logger);

            // Initialize WebJob
            var listener = ConfigurationManager.ConnectionStrings["WebHookListener"].ConnectionString;
            JobHostConfiguration config = new JobHostConfiguration
            {
                StorageConnectionString = listener
            };
            JobHost host = new JobHost(config);
            host.RunAndBlock();
        }
Beispiel #2
0
 /// <summary>
 /// Gets a default <see cref="ILogger"/> implementation which is used if none are registered with the
 /// Dependency Engine.
 /// </summary>
 public static ILogger GetLogger()
 {
     if (_logger == null)
     {
         ILogger instance = new TraceLogger();
         Interlocked.CompareExchange(ref _logger, instance, null);
     }
     return _logger;
 }