Серверный JavaScript 1.4. Руководство по использованию


         

Функция для удаления старых специальных


      }
      else {

         var now = (new Date()).getTime();

         if ( customClient.expiration <= now ) {

            delete customClients[customClientID];

            deathRow = customClient;

             customClient = new CustomClient(timeout);
             newObjectWasCreated = true;
         }

         else {
             customClient.expiration = (new Date()).getTime() +

               timeout*1000;

         }
      }

   }
   if ( newObjectWasCreated )
       customClient.onInit();
   customClientLock.unlock();

   if ( deathRow != null )
       deathRow.onDestroy();
   return customClient;
}

// Функция для удаления старых специальных объектов client.

function expireCustomClients()

{
   var customClients = getCustomClients();

   var now = (new Date()).getTime();
   for ( var i in customClients ) {

      var clientObj = customClients[i];

      if ( clientObj.expiration <= now ) {

         var customClientLock = getCustomClientLock();

         customClientLock.lock();


Содержание  Назад  Вперед