Last active
August 29, 2015 14:08
-
-
Save nickheppleston/ab48643202f12a16fa35 to your computer and use it in GitHub Desktop.
Message Worker - Worker Role - OnStart() Method
This file contains 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 MessageWorker : RoleEntryPoint | |
{ | |
/* This GIST only demonstrates the OnStart() method. */ | |
public override bool OnStart() | |
{ | |
Trace.WriteLine("Starting MessageWorker Worker Role Instance..."); | |
// Initialize Worker Role Configuration | |
InitializeConfigurationSettings(); | |
// Re-configure Logging (update logging to runtime configuration settings) | |
LogTargetManager.SetLogTargetBaseDirectory("MessageWorker", RoleEnvironment.GetLocalResource("CustomLogs").RootPath); | |
LogLevelManager.SetMinimimLogLevel(_workerRoleConfiguration.MinimumLogLevel); | |
// Formally start the Worker Role Instance | |
logger.Info("Starting Worker Role Instance (v{0})...", Assembly.GetExecutingAssembly().GetName().Version.ToString()); | |
// Log Configuration Settings | |
LogConfigurationSettings(); | |
// Set the maximum number of concurrent connections | |
ServicePointManager.DefaultConnectionLimit = 12; | |
return (base.OnStart()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment