using System;
using System.Threading.Tasks;
using Quadarax.Foundation.Core.Logging;

namespace Quadarax.Foundation.Core.Thread
{
    public class ContinousWorker : AbstractWorker
    {
        #region *** Private fields ***
        private Action _body;
        #endregion

        #region *** Properties ***
        #endregion

        #region *** Constructors ***
        public ContinousWorker(Action body = null) : base()
        {
            _body = body;
        }
        public ContinousWorker(string workerName, ILogger logger = null) : base(workerName,null, logger)
        {
        }
        #endregion

        #region *** Public Operations ***
        #endregion

        #region *** Virtuals and protected ***
        protected override async Task Do(IWorkerContext context)
        {
            _body?.Invoke();
        }
        #endregion

        #region *** Private Operations ***
        #endregion

    }
}
