コード例 #1
0
 public JobHandle ScheduleUpdate(JobHandle dep = default(JobHandle))
 {
     dep = new CleanJob {
         driver = this
     }.Schedule(dep);
     dep = new UpdateJob {
         driver = this
     }.Schedule(dep);
     return(dep);
 }
コード例 #2
0
    protected void Clean <T>() where T : struct, IComponentData
    {
        var cg  = GetComponentGroup(ComponentType.Create <T>());
        var ecb = new EntityCommandBuffer(Allocator.TempJob);

        ecbs.Add(ecb);
        var job = new CleanJob <T>
        {
            entiType = GetArchetypeChunkEntityType(),
            ecb      = ecb.ToConcurrent(),
        }
        .Schedule(cg, input);

        jobHandles.Add(job);
    }
コード例 #3
0
ファイル: Startup.cs プロジェクト: ronnyt43525/Bazooka
        public void Configuration(IAppBuilder app)
        {
            app.UseErrorPage();
            app.UseWelcomePage("/");
            app.UseHangfire(config =>
            {
                var options = new SqlServerStorageOptions {
                    QueuePollInterval = TimeSpan.FromSeconds(1)
                };
                config.UseSqlServerStorage("DataContext", options).UseMsmqQueues(@".\private$\hangfire-0");
                config.UseServer();
            });

            RecurringJob.AddOrUpdate(() => CleanJob.Execute(), System.Configuration.ConfigurationManager.AppSettings["CleanJobSchedule"]);
            RecurringJob.AddOrUpdate(() => LogsCompactionJob.Execute(), System.Configuration.ConfigurationManager.AppSettings["LogCompactionJobSchedule"]);
            RecurringJob.AddOrUpdate(() => GalleryCleaningJob.Execute(), System.Configuration.ConfigurationManager.AppSettings["GalleryCleanupJob"]);
            RecurringJob.AddOrUpdate(() => HealthCheckJob.Execute(), System.Configuration.ConfigurationManager.AppSettings["HealthCheckJob"]);
        }
コード例 #4
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var currentTime = (float)Time.ElapsedTime;

            if (currentTime - _lastUpdateTime < UpdateIntervalTime)
            {
                return(inputDeps);
            }

            _lastUpdateTime = currentTime;

            var job = new CleanJob
            {
                CoolDownTime = CoolDownTime,
                CurrentTime  = currentTime
            };

            return(job.Schedule(this, inputDeps));
        }
コード例 #5
0
        protected override JobHandle OnUpdate(JobHandle inputDep)
        {
            var handle = inputDep;

            var job = new Job {
                command_buffer_   = barrier_.CreateCommandBuffer(),
                entity_list_      = group_.entity_list_,
                destroyable_list_ = group_.destroyable_list_,
            };

            handle = job.Schedule(group_.Length, 32, handle);

            var cjob = new CleanJob {
                command_buffer_ = barrier_.CreateCommandBuffer(),
                destroyable_list_from_entity_ = destroyable_list_from_entity_,
                entity_list_ = child_group_.entity_list_,
                parent_list_ = child_group_.parent_list_,
            };

            handle = cjob.Schedule(child_group_.Length, 32, handle);

            return(handle);
        }