Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
markzhai committed Oct 4, 2015
1 parent f723900 commit e05ff54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Init
Init helps Android apps schedule initialization of application, with type, priority and
multi-process, tidy magic code for every process, and improves efficiency of application start.
Init helps Android apps schedule initialization of application, with type, priority and multi-process, tidy magic code for every process, and improves efficiency of application start.

It is originally designed for application initialization, but not confined to that, it can be
applied to any complex initialization procedure.
It is originally designed for application initialization, but not confined to that, it can be applied to any complex initialization procedure.

[For Chinese 中文戳这里](https://github.com/markzhai/init/blob/master/README_CN.md)

Expand Down Expand Up @@ -129,9 +127,7 @@ public class ProcessInit {
}
```
You see how complicated the initialization can be when the application grows, some operation should
be after the other, and some can be done parallel, and some... Then we need to change the implementation
of every init, to make some asynchronous, which makes code dirty and hard to understand.
You see how complicated the initialization can be when the application grows, some operation should be after the other, and some can be done parallel, and some... Then we need to change the implementation of every init, to make some asynchronous, which makes code dirty and hard to understand.
How to make it simpler? I came up with this library.
Expand All @@ -141,11 +137,9 @@ The initialization procedure is abstracted to flow, wave and task.
![flow](art/flow.png "how it works")
Flow is a coarse-grained concept, normally we have only one flow, but under certain condition, we
may have several flow like patch flow, broadcast flow, etc.
Flow is a coarse-grained concept, normally we have only one flow, but under certain condition, we may have several flow like patch flow, fake UI flow(to make user feel faster), broadcast flow, etc.
Each wave can be started only when all blocked task in last wave finished, and all tasks belongs to
the wave will started at the same time(if no delay set).
Each wave can be started only when all blocked task in last wave finished, and all tasks belongs tothe wave will started at the same time(if no delay set).
As for task, they can be divided into two types
1. Blocked task, blue tasks in the picture.
Expand Down
9 changes: 3 additions & 6 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Init
Init帮助Android应用调度初始化流程,囊括类型、优先级、多进程,清理原来为每个进程判断是否要执行的神奇代码逻辑,
提高应用启动效率。
Init帮助Android应用调度初始化流程,囊括类型、优先级、多进程,清理原来为每个进程判断是否要执行的神奇代码逻辑,提高应用启动效率。

尽管Init设计的初衷是为了应用(application)初始化,但并不局限于此,它可以于应用在任何复杂的初始化流程。

Expand Down Expand Up @@ -118,8 +117,7 @@ public class ProcessInit {
}
```

你看到了当一个应用越来越大以后初始化能是一件多么复杂的事情,有些操作必须在另一个之后,而又有一些可以并行执行,又
有的操作......于是我们就得把每个独立的操作进行修改,有的改成异步,有的则阻塞在另一个操作后,使得代码杂乱难以维护。
你看到了当一个应用越来越大以后初始化能是一件多么复杂的事情,有些操作必须在另一个之后,而又有一些可以并行执行,又有的操作又需要在一个异步操作完成后才能执行......于是我们就得把每个独立的操作进行修改,有的改成异步,有的则阻塞在另一个操作后,使得代码杂乱且难以维护。

怎么可以使它变得简单呢?Init就是来帮助你做这个事的。

Expand All @@ -129,8 +127,7 @@ public class ProcessInit {

![flow](art/flow.png "how it works")

flow是一个粗粒度概念,通常一个应用只有一个flow,但某些情况下我们可能拥有多个flow,像是patch flow,broadcast
flow等等。
flow是一个粗粒度概念,通常一个应用只有一个flow,但某些情况下我们可能拥有多个flow,像是patch flow,broadcast flow,fake UI flow等等,可以把它们都交给Init处理。

每个wave只有在上一wave的所有阻塞task完成后才能开始,而所有属于该wave的task会一起开始执行(除非被赋予了delay)。

Expand Down

0 comments on commit e05ff54

Please sign in to comment.