Exemple #1
0
 public FullUserServisces(IUserServices userServices, IWorkerServices worekerServices, IRoleServices roleServices, IUserRoleServices userRoleServices)
 {
     _roleServices     = roleServices;
     _userServices     = userServices;
     _workerServices   = worekerServices;
     _userRoleServices = userRoleServices;
 }
        IDisposable Schedule(Action task, TimeSpan initialDelay, TimeSpan period, IWorkerServices worker = null)
        {
            if (Volatile.Read(ref state) != 2)
            {
                var run = runner;

                var t = new InterruptibleAction(task, true);
                t.parent = worker;

                if (worker == null || worker.AddAction(t))
                {
                    var d = timed.Schedule(() =>
                    {
                        if (!t.IsDisposed)
                        {
                            run.Offer(t.Run);
                        }
                    }, initialDelay, period);
                    DisposableHelper.Replace(ref t.resource, d);

                    return(t);
                }
            }
            return(EmptyDisposable.Instance);
        }
 public OrderController(IFullUserServices fullUserServices, IWorkerServices workerServices, IClientServices clientServices, IOrderServices orderServices, IOrderInfoServise orderInfoServise)
 {
     _fullUserServices = fullUserServices;
     _workerServises   = workerServices;
     _clientServices   = clientServices;
     _orderServices    = orderServices;
     _orderInfoServise = orderInfoServise;
 }
 public HomeController(IMemberServices services, IDepartmentService departmentService, IWorkerServices worker, IMemberServices member, ISermonServices sermon, ApplicationDbContext applicationDb, IEventServices eventServices)
 {
     _memberServices = services;
     _dtservice      = departmentService;
     _event          = eventServices;
     _sermonServices = sermon;
     _workServ       = worker;
     _context        = applicationDb;
 }
Exemple #5
0
 public IDisposable Schedule(Action task, IWorkerServices worker = null)
 {
     if (Prepare())
     {
         InterruptibleAction ia = new InterruptibleAction(task);
         ia.parent = worker;
         if (worker == null || worker.AddAction(ia))
         {
             if (runner.Offer(ia.Run))
             {
                 return(ia);
             }
         }
     }
     return(EmptyDisposable.Instance);
 }
Exemple #6
0
        public IDisposable Schedule(Action task, TimeSpan delay, IWorkerServices worker = null)
        {
            if (Prepare())
            {
                var run = runner;
                var t   = new InterruptibleAction(task);
                t.parent = worker;
                if (worker == null || worker.AddAction(t))
                {
                    var d = timed.Schedule(() =>
                    {
                        run.Offer(t.Run);
                    }, delay);

                    DisposableHelper.Replace(ref t.resource, d);

                    return(t);
                }
            }
            return(EmptyDisposable.Instance);
        }
Exemple #7
0
 public DirectorController(IWorkerServices workerServices, IFullUserServices fullUserServices, IRoleServices roleServices)
 {
     _workerServises   = workerServices;
     _roleServices     = roleServices;
     _fullUserServices = fullUserServices;
 }
 public ChartManager(IOrderServices orderServices, IOrderInfoServices orderInfoServices, IWorkerServices workerServices)
 {
     _orderServices     = orderServices;
     _orderInfoServices = orderInfoServices;
     _workerServices    = workerServices;
 }
Exemple #9
0
 public WorkerController(IWorkerServices workerServices, ApplicationDbContext context, IDepartmentService department)
 {
     _context    = context;
     _workServ   = workerServices;
     _dptservice = department;
 }