11# IPCInvoker
22
33[ ![ license] ( http://img.shields.io/badge/license-Apache2.0-brightgreen.svg?style=flat )] ( https://github.com/AlbieLiang/IPCInvoker/blob/master/LICENSE )
4- [ ![ Release Version] ( https://img.shields.io/badge/release-1.2.2 -red.svg )] ( https://github.com/AlbieLiang/IPCInvoker/releases )
5- [ ![ wiki] ( https://img.shields.io/badge/wiki-1.2.2 -red.svg )] ( https://github.com/AlbieLiang/IPCInvoker/wiki )
4+ [ ![ Release Version] ( https://img.shields.io/badge/release-1.2.5 -red.svg )] ( https://github.com/AlbieLiang/IPCInvoker/releases )
5+ [ ![ wiki] ( https://img.shields.io/badge/wiki-1.2.5 -red.svg )] ( https://github.com/AlbieLiang/IPCInvoker/wiki )
66[ ![ PRs Welcome] ( https://img.shields.io/badge/PRs-welcome-brightgreen.svg )] ( https://github.com/AlbieLiang/IPCInvoker/pulls )
77
88
@@ -141,20 +141,21 @@ public class IPCTaskTestCase {
141141 IPCTask . create(" cc.suitalk.ipcinvoker.sample:push" )
142142 .timeout(10 )
143143 .async(AsyncInvokeTask . class)
144- .data(new IPCString ( " test invokeAsync" ) )
144+ .data(" test invokeAsync" )
145145 .defaultResult(false )
146- .callback(new IPCInvokeCallback<Boolean > () {
146+ .callback(true , new IPCInvokeCallback<Boolean > () {
147147 @Override
148148 public void onCallback (Boolean data ) {
149+ // / callback on UI Thread
149150 Log . i(TAG , " invokeAsync result : %s" , data);
150151 }
151152 }). invoke();
152153 }
153154
154- private static class AsyncInvokeTask implements IPCAsyncInvokeTask<IPCString , Boolean > {
155+ private static class AsyncInvokeTask implements IPCAsyncInvokeTask<String , Boolean > {
155156
156157 @Override
157- public void invoke (IPCString data , IPCInvokeCallback<Boolean > callback ) {
158+ public void invoke (String data , IPCInvokeCallback<Boolean > callback ) {
158159 callback. onCallback(true );
159160 }
160161 }
@@ -168,19 +169,21 @@ public class IPCTaskTestCase {
168169 private static final String TAG = " IPCTaskTestCase" ;
169170
170171 public static void invokeSync () {
172+ Map<String , Object > map = new HashMap<> ();
173+ map. put(" key" , " value" );
171174 Boolean result = IPCTask . create(" cc.suitalk.ipcinvoker.sample:push" )
172175 .timeout(20 )
173176 .sync(SyncInvokeTask . class)
174- .data(" test invokeSync " )
177+ .data(map )
175178 .defaultResult(false )
176179 .invoke();
177180 Log . i(TAG , " invokeSync result : %s" , result);
178181 }
179182
180- private static class SyncInvokeTask implements IPCSyncInvokeTask<String , Boolean > {
183+ private static class SyncInvokeTask implements IPCSyncInvokeTask<Map< String , Object > , Boolean > {
181184
182185 @Override
183- public Boolean invoke (String data ) {
186+ public Boolean invoke (Map< String , Object > data ) {
184187 return true ;
185188 }
186189 }
0 commit comments