Esempio n. 1
0
        private void TheThread()
        {
            while (true)
            {
                WorkItem it = queue.Take();

                if (it.IsTerminateRequest)
                {
                    terminated = true;
                    return;
                }

                try {
                    FileWrite.WriteFileOrThrow(fileName, it.Content, Encoding.UTF8, maxRetry: 5, retryDelayFactor: 50);
                    it.Promise.SetResult(true);
                }
                catch (Exception exp) {
                    it.Promise.SetException(exp);
                }
            }
        }
Esempio n. 2
0
 protected virtual void WriteConfigFile(string modelFileName, string modelAsString)
 {
     FileWrite.WriteFileOrThrow(modelFileName, modelAsString, Encoding.UTF8, maxRetry: 5, retryDelayFactor: 50);
 }