Giter Site home page Giter Site logo

depthfirstscheduler's Introduction

I decided to integrate this library with UniVRM for maintenance reason (submodule burdensome). Continue updating within UniVRM

DepthFirstScheduler(深さ優先スケジューラー)

Asynchronous task scheduler for Unity-5.6 or later

これは、Unity5.6でTaskが無いことを補完するためのライブラリです。 木構造にタスクを組み立てて深さ優先で消化します。

  • タスクの実行スケジューラー(Unityメインスレッドやスレッドプール)を指定できる

使い方

var schedulable = new Schedulable<Unit>();

schedulable
    .AddTask(Scheduler.ThreadPool, () => // 子供のタスクを追加する
    {
        return glTF_VRM_Material.Parse(ctx.Json);
    })
    .ContinueWith(Scheduler.MainThread, gltfMaterials => // 兄弟のタスクを追加する
    {
        ctx.MaterialImporter = new VRMMaterialImporter(ctx, gltfMaterials);
    })
    .Subscribe(Scheduler.MainThread, onLoaded, onError);
    ;

Schedulable

T型の結果を返すタスク。

AddTask(IScheduler scheduler, Func firstTask)

子供のタスクを追加する。

ToDo: 一つ目の子供に引数を渡す手段が無い

ContinueWith

ContinueWithCoroutine

OnExecute

動的にタスクを追加するためのHook。

中で、

parent.AddTask

することで実行時に子タスクを追加できる。

Subscribe

タスクの実行を開始する。 実行結果を得る。

Scheduler

StepScheduler

Unity

CurrentThreadScheduler

即時

ThreadPoolScheduler

スレッド

ThreadScheduler

スレッド

depthfirstscheduler's People

Contributors

ousttrue avatar torisoup avatar

Watchers

James Cloos avatar James park avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.