You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -398,25 +374,13 @@ import { Unport } from 'unport';
398
374
399
375
exporttypeDefinition= {
400
376
parent2child: {
401
-
syn: {
402
-
pid:string;
403
-
};
404
-
getInfo__callback: {
405
-
user:string;
377
+
getParentInfo__callback: {
378
+
content:string;
406
379
};
407
-
getChildInfo: {
408
-
name:string;
409
-
}
410
380
};
411
381
child2parent: {
412
-
getInfo: {
413
-
id:string;
414
-
};
415
-
getChildInfo__callback: {
416
-
clientKey:string;
417
-
};
418
-
ack: {
419
-
pid:string;
382
+
getParentInfo: {
383
+
user:string;
420
384
};
421
385
};
422
386
};
@@ -427,6 +391,10 @@ export type ParentPort = Unport<Definition, 'parent'>;
427
391
428
392
In comparison to Unport, the only new concept to grasp is that the RPC response message key must end with `__callback`. Other than that, no additional changes are necessary! `Unrpc` also offers comprehensive type inference based on this convention; for instance, you won't be able to implement an RPC method that is meant to serve as a response.
429
393
394
+
> [!NOTE]
395
+
> You can find the full code example here: [child-process-rpc](https://github.com/web-infra-dev/unport/tree/main/examples/child-process-rpc).
396
+
>
397
+
430
398
## 🤝 Contributing
431
399
432
400
Contributions, issues and feature requests are welcome!
0 commit comments