Skip to content

Commit

Permalink
feat(readme): publish v1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Justson committed Aug 10, 2020
1 parent d2708fb commit 4b871b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Flying-Pigeon 内部提供两种跨进程通信方式,来应对各种跨进程


```gradle
implementation 'com.github.Justson:flying-pigeon:v1.0.3'
implementation 'com.github.Justson:flying-pigeon:v1.0.4'
```

## 方式一
Expand All @@ -32,24 +32,19 @@ ServiceManager.getInstance().publish(mApi);
### Client
``` java
final Pigeon pigeon = Pigeon.newBuilder(this).setAuthority(ServiceApiImpl.class).build();
Api api = pigeon.create(Api.class);
Poster poster = new Poster("Justson", "just", 119, 11111000L, (short) 23, 1.15646F, 'h', (byte) 4, 123456.415D);
api.createPoster(poster);
Api api = pigeon.create(Api.class);
api.createPoster(new Poster("Justson", "just", 119, 11111000L, (short) 23, 1.15646F, 'h', (byte) 4, 123456.415D));
```

## 方式二

### Server

```java
@MainThread
@route("/query/username")
public void queryUsername(final Bundle in, final Bundle out) {
runOnUiThread(new Runnable() {
@Override
public void run() {
ipcLabel.setText("received other app message,\n message:" + in.getString("userid"));
}
});
ipcLabel.setText("received other app message,\n message:" + in.getString("userid"));
out.putString("username", "ipc-sample");
}
```
Expand All @@ -66,4 +61,5 @@ Bundle bundle = flyPigeon.route("/query/username").withString("userid", UUID.ran
```

## 建议
> 建议App内使用方式一,App与其他App通信使用方式二
* 建议App内使用方式一,App与其他App通信使用方式二
* 返回的类型中,尽可能使用基本数据类型的包装类、如Integer,Double,Long,Short,Float,Byte,Boolean,Character
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.flyingpigeon.library.annotations.thread.MainThread;
import com.flyingpigeon.library.annotations.thread.SingleThread;
import com.flyingpigeon.library.execute.Executors;
import com.queue.library.Dispatch;
import com.queue.library.DispatchThread;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
Expand All @@ -32,7 +32,7 @@
public abstract class AbsMethodInvoker implements MethodInvoker {

private final Method target;
private Dispatch mDispatch;
private DispatchThread mDispatch;

public AbsMethodInvoker(Method target) {
this.target = target;
Expand Down

0 comments on commit 4b871b9

Please sign in to comment.