internal static void Initialize()
        {
            TasksQueueStatic = new CommonLibs.Utils.Tasks.TasksQueue();
            ConnectionListStatic = new CommonLibs.Web.LongPolling.ConnectionList( TasksQueueStatic );
            MessageHandlerStatic = new CommonLibs.Web.LongPolling.MessageHandler( TasksQueueStatic, ConnectionListStatic );

            #if DEBUG
                // Increase stale & disconnection timeouts during development so unwanted disconnections don't occures when using breakpoints
                ConnectionListStatic.DisconnectionSeconds = 60*60;  // 1H
                ConnectionListStatic.StaleConnectionSeconds = 60*60;  // 1H
            #endif

            // Registering message handlers
            MessageHandlerStatic.AddMessageHandler( SiteMaster.PingMessageType, SiteMaster.PingMessageHandler );
            MessageHandlerStatic.AddMessageHandler( "Test01_TestCrash", Test01Crash.TestCrashHandler );
        }
Exemple #2
0
        internal static void Initialize()
        {
            TasksQueueStatic     = new CommonLibs.Utils.Tasks.TasksQueue();
            ConnectionListStatic = new CommonLibs.Web.LongPolling.ConnectionList(TasksQueueStatic);
            MessageHandlerStatic = new CommonLibs.Web.LongPolling.MessageHandler(TasksQueueStatic, ConnectionListStatic);

                        #if DEBUG
            // Increase stale & disconnection timeouts during development so unwanted disconnections don't occures when using breakpoints
            ConnectionListStatic.DisconnectionSeconds   = 60 * 60;                  // 1H
            ConnectionListStatic.StaleConnectionSeconds = 60 * 60;                  // 1H
                        #endif

            // Registering message handlers
            MessageHandlerStatic.AddMessageHandler(SiteMaster.PingMessageType, SiteMaster.PingMessageHandler);
            MessageHandlerStatic.AddMessageHandler("Test01_TestCrash", Test01Crash.TestCrashHandler);
        }
Exemple #3
0
        internal TaskEntry(TasksQueue tasks, DateTime executionDate, Statuses initialStatus, Action <TaskEntry> callback)
        {
            ASSERT((initialStatus == Statuses.Delayed) || (initialStatus == Statuses.Queued), "Invalid 'initialStatus'");
            ASSERT(executionDate.Kind == DateTimeKind.Utc, "'executionDate' is not in UTC");

            ID            = Guid.NewGuid();
            LockObject    = this;
            Tasks         = tasks;
            ExecutionDate = executionDate;
            Status        = initialStatus;
            Callback      = callback;

            if (Tasks.TransferCultureInfo)
            {
                CreatorCultureInfo   = Thread.CurrentThread.CurrentCulture;
                CreatorUICultureInfo = Thread.CurrentThread.CurrentUICulture;
            }
            else
            {
                CreatorCultureInfo   = null;
                CreatorUICultureInfo = null;
            }
        }