summaryrefslogtreecommitdiff
path: root/lib/kernel/doc/src/erpc.xml
blob: 1c5ac214b0dc5efc975d73cd35c8db053435ef41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>
  <header>
    <copyright>
      <year>2020</year><year>2023</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
 
          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    
    </legalnotice>

    <title>erpc</title>
    <prepared>Rickard Green</prepared>
    <docno>1</docno>
    <date>2020-02-20</date>
    <rev>A</rev>
  </header>
  <module since="OTP 23.0">erpc</module>
  <modulesummary>Enhanced Remote Procedure Call</modulesummary>
  <description>
    <p>
      This module provide services similar to Remote Procedure Calls.
      A remote procedure call is a method to call a function on a remote
      node and collect the answer. It is used for collecting information
      on a remote node, or for running a function with some specific side
      effects on the remote node.
    </p>
    <p>
      This is an enhanced subset of the operations provided by the
      <seeerl marker="rpc"><c>rpc</c></seeerl> module. Enhanced in the
      sense that it makes it possible to distinguish between returned
      value, raised exceptions, and other errors. <c>erpc</c> also has
      better performance and scalability than the original <c>rpc</c>
      implementation. However, current <c>rpc</c> module will utilize
      <c>erpc</c> in order to also provide these properties when
      possible.
    </p>
    <p>
      In order for an <c>erpc</c> operation to succeed, the remote
      node also needs to support <c>erpc</c>. Typically only ordinary
      Erlang nodes as of OTP 23 have <c>erpc</c> support.
    </p>
    <p>
      Note that it is up to the user to ensure that correct code to
      execute via <c>erpc</c> is available on the involved nodes.
    </p>
    <note><p>
      For some important information about distributed signals, see the
      <seeguide marker="system/reference_manual:processes#blocking-signaling-over-distribution">
        Blocking Signaling Over Distribution</seeguide> section in the
      <i>Processes</i> chapter of the <i>Erlang Reference Manual</i>.
      Blocking signaling can, for example, cause timeouts in <c>erpc</c>
      to be significantly delayed.
    </p></note>
  </description>

  <datatypes>
    <datatype>
      <name name="request_id"/>
      <desc>
        <p>
	  An opaque request identifier. For more information see
          <seemfa marker="#send_request/4"><c>send_request/4</c></seemfa>.
	</p>
      </desc>
    </datatype>
    <datatype>
      <name name="request_id_collection"/>
      <desc>
        <p>
	  An opaque collection of request identifiers
          (<seetype marker="#request_id"><c>request_id()</c></seetype>)
          where each request identifier can be associated with a label
          chosen by the user. For more information see
          <seemfa marker="#reqids_new/0"><c>reqids_new/0</c></seemfa>.
	</p>
      </desc>
    </datatype>
    <datatype>
      <name name="timeout_time"/>
      <desc>
        <taglist>
          <tag><c>0..4294967295</c></tag>
          <item><p>
            Timeout relative to current time in milliseconds.
          </p></item>
          <tag><c>infinity</c></tag>
          <item><p>
            Infinite timeout. That is, the operation will never time out.
          </p></item>
          <tag><c>{abs, Timeout}</c></tag>
          <item><p>
            An absolute
            <seemfa marker="erts:erlang#monotonic_time/1">Erlang monotonic time</seemfa>
            timeout in milliseconds. That is, the operation will time out when
            <seemfa marker="erts:erlang#monotonic_time/1"><c>erlang:monotonic_time(millisecond)</c></seemfa>
            returns a value larger than or equal to <c>Timeout</c>. <c>Timeout</c>
            is not allowed to identify a time further into the future than <c>4294967295</c>
            milliseconds. Identifying the timeout using an absolute timeout value
            is especially handy when you have a deadline for responses corresponding
            to a complete collection of requests
            (<seetype marker="#request_id_collection"><c>request_id_collection()</c></seetype>)
,
            since you do not have to recalculate the relative time until the deadline
            over and over again.
	  </p></item>
        </taglist>
      </desc>
    </datatype>

  </datatypes>

  <funcs>

    <func>
      <name name="call" arity="2" since="OTP 23.0"/>
      <name name="call" arity="3" since="OTP 23.0"/>
      <fsummary>Evaluate a function call on a node.</fsummary>
      <desc>
	<p>
	  The same as calling
	  <seemfa marker="#call/5"><c>erpc:call(<anno>Node</anno>,
          erlang, apply, [<anno>Fun</anno>,[]], <anno>Timeout</anno>)</c></seemfa>.
	  May raise all the same exceptions as <c>call/5</c>
	  plus an <c>{erpc, badarg}</c> <c>error</c>
	  exception if <c><anno>Fun</anno></c> is not a fun of
	  zero arity.
	</p>
	<p>
	  The call <c>erpc:call(<anno>Node</anno>,<anno>Fun</anno>)</c>
	  is the same as the call
	  <c>erpc:call(<anno>Node</anno>,<anno>Fun</anno>,infinity)</c>.
	</p>
      </desc>
    </func>

    <func>
      <name name="call" arity="4" since="OTP 23.0"/>
      <name name="call" arity="5" since="OTP 23.0"/>
      <fsummary>Evaluate a function call on a node.</fsummary>
      <desc>
        <p>
	  Evaluates <c>apply(<anno>Module</anno>, <anno>Function</anno>,
          <anno>Args</anno>)</c> on node <c><anno>Node</anno></c> and returns
          the corresponding value <c><anno>Result</anno></c>.
          <c><anno>Timeout</anno></c> sets an upper time limit
          for the <c>call</c> operation to complete.
	</p>
	<p>The call <c>erpc:call(<anno>Node</anno>, <anno>Module</anno>,
	<anno>Function</anno>, <anno>Args</anno>)</c> is equivalent
	to the call <c>erpc:call(<anno>Node</anno>, <anno>Module</anno>,
	<anno>Function</anno>, <anno>Args</anno>, infinity)</c></p>
	<p>
	  The <c>call()</c> function only returns if the applied
	  function successfully returned without raising any uncaught
	  exceptions, the operation did not time out, and no failures
	  occurred. In all other cases an exception is raised. The
	  following exceptions, listed by exception class, can
	  currently be raised by <c>call()</c>:
	</p>
	<taglist>
	  <tag><c>throw</c></tag>
	  <item><p>
	    The applied function called <c>throw(Value)</c>
	    and did not catch this exception. The exception
	    reason <c>Value</c> equals the argument passed to
	    <c>throw/1</c>.
	  </p></item>
	  
	  <tag><c>exit</c></tag>
	  <item><p>
	    Exception reason:
	  </p>
	  <taglist>
	    <tag><c>{exception, ExitReason}</c></tag>
	    <item><p>
	      The applied function called <c>exit(ExitReason)</c>
	      and did not catch this exception. The exit
	      reason <c>ExitReason</c> equals the argument passed
	      to <c>exit/1</c>.
	    </p></item>
	    <tag><c>{signal, ExitReason}</c></tag>
	    <item><p>
	      The process that applied the function received an
	      exit signal and terminated due to this signal. The
	      process terminated with exit reason <c>ExitReason</c>.
	    </p></item>
	  </taglist>
	  </item>
	  
	  <tag><c>error</c></tag>
	  <item><p>
	    Exception reason:
	  </p>
	  <taglist>
	    
	    <tag><c>{exception, ErrorReason, StackTrace}</c></tag>
	    <item><p>
	      A runtime error occurred which raised an error
	      exception while applying the function,
	      and the applied function did not catch the
	      exception. The error reason <c>ErrorReason</c>
	      indicates the type of error that occurred.
	      <c>StackTrace</c> is formatted as when caught in a
	      <c>try/catch</c> construct. The <c>StackTrace</c>
	      is limited to the applied function and functions
	      called by it.
	    </p></item>
	    
	    <tag><c>{erpc, ERpcErrorReason}</c></tag>
	    <item><p>
	      The <c>erpc</c> operation failed. The following
	      <c>ERpcErrorReason</c>s are the most common ones:
	    </p>
	    
	    <taglist>
	      <tag><c>badarg</c></tag>
	      <item>
		<p>If any one of these are true:</p>
		<list>
		  <item><p><c><anno>Node</anno></c> is not an atom.</p></item>
		  <item><p><c><anno>Module</anno></c> is not an atom.</p></item>
		  <item><p><c><anno>Function</anno></c> is not an atom.</p></item>
		  <item><p><c><anno>Args</anno></c> is not a list.
		  Note that the list is not verified to be
		  a proper list at the client side.</p></item>
		  <item><p><c><anno>Timeout</anno></c> is
                  invalid.</p></item>
		</list>
	      </item>
	      
	      <tag><c>noconnection</c></tag>
	      <item><p>
		The connection to <c>Node</c> was lost or could
		not be established. The function may or may not
		be applied.
	      </p></item>
	      
	      <tag><c>system_limit</c></tag>
	      <item><p>
		The <c>erpc</c> operation failed due to some system
		limit being reached. This typically due to failure
		to create a process on the remote node <c>Node</c>,
		but can be other things as well.
	      </p></item>
	      
	      <tag><c>timeout</c></tag>
	      <item><p>
		The <c>erpc</c> operation timed out. The function may
		or may not be applied.
	      </p></item>
	      
	      <tag><c>notsup</c></tag>
	      <item><p>
		The remote node <c>Node</c> does not support
		this <c>erpc</c> operation.
	      </p>
	      </item>
	      
	    </taglist>
	    </item>
	    
	  </taglist>
	  </item>
	</taglist>

	<p>
	  If the <c>erpc</c> operation fails, but it is unknown if
	  the function is/will be applied (that is, a timeout or
	  a connection loss), the caller will not receive any
	  further information about the result if/when the applied
	  function completes. If the applied function explicitly
	  communicates with the calling process, such communication
	  may, of course, reach the calling process.
        </p>

	<note>
	  <p>
	    You cannot make <em>any</em> assumptions about the
	    process that will perform the <c>apply()</c>. It may
	    be the calling process itself, a server, or a freshly
	    spawned process.
	  </p>
	</note>
      </desc>
    </func>

    <func>
      <name name="cast" arity="2" since="OTP 23.0"/>
      <fsummary>Evaluate a function call on a node.</fsummary>
      <desc>
	<p>
	  The same as calling
	  <seemfa marker="#cast/4"><c>erpc:cast(<anno>Node</anno>,erlang,apply,[<anno>Fun</anno>,[]])</c></seemfa>.
	</p>
	<p><c>cast/2</c> fails with an <c>{erpc, badarg}</c>
	<c>error</c> exception if:</p>
	<list>
	  <item><p><c><anno>Node</anno></c> is not an atom.</p></item>
	  <item><p><c><anno>Fun</anno></c> is not a a fun of zero arity.</p></item>
	</list>
      </desc>
    </func>

    <func>
      <name name="cast" arity="4" since="OTP 23.0"/>
      <fsummary>Evaluate a function call on a node ignoring the result.</fsummary>
      <desc>
        <p>
	  Evaluates <c>apply(<anno>Module</anno>, <anno>Function</anno>,
          <anno>Args</anno>)</c> on node
          <c><anno>Node</anno></c>. No response is delivered to the
	  calling process. <c>cast()</c> returns immediately
	  after the cast request has been sent. Any failures beside
	  bad arguments are silently ignored.
	</p>
	<p><c>cast/4</c> fails with an <c>{erpc, badarg}</c>
	<c>error</c> exception if:</p>
	<list>
	  <item><p><c><anno>Node</anno></c> is not an atom.</p></item>
	  <item><p><c><anno>Module</anno></c> is not an atom.</p></item>
	  <item><p><c><anno>Function</anno></c> is not an atom.</p></item>
	  <item><p><c><anno>Args</anno></c> is not a list. Note that
	  the list is not verified to be a proper list at the client
	  side.</p></item>
	</list>
	<note>
	  <p>
	    You cannot make <em>any</em> assumptions about the
	    process that will perform the <c>apply()</c>. It may
	    be a server, or a freshly spawned process.
	  </p>
	</note>
      </desc>
    </func>
    
    <func>
      <name name="check_response" arity="2" since="OTP 23.0"/>
      <fsummary>Check if a message is a response corresponding to a
      previously sent call request.</fsummary>
      <desc>
	<p>
	  Check if a message is a response to a <c>call</c> request
	  previously made by the calling process using
	  <seemfa marker="#send_request/4"><c>send_request/4</c></seemfa>.
	  <c><anno>RequestId</anno></c> should be the value returned
	  from the previously made <c>send_request/4</c> call,
	  and the corresponding response should not already have been
	  received and handled to completion by <c>check_response/2</c>,
	  <seemfa marker="#receive_response/2"><c>receive_response/2</c></seemfa>, or
	  <seemfa marker="#wait_response/2"><c>wait_response/2</c></seemfa>.
	  <c><anno>Message</anno></c> is the message to check.
	</p>
	<p>
	  If <c><anno>Message</anno></c> does not correspond to the
	  response, the atom <c>no_response</c> is returned. If
	  <c><anno>Message</anno></c> corresponds to the response, the
	  <c>call</c> operation is completed and either the result is
	  returned as <c>{response, Result}</c> where <c>Result</c>
	  corresponds to the value returned from the applied function
	  or an exception is raised. The exceptions that can be raised
	  corresponds to the same exceptions as can be raised by
	  <seemfa marker="#call/4"><c>call/4</c></seemfa>.
	  That is, no <c>{erpc, timeout}</c> <c>error</c> exception
	  can be raised. <c>check_response()</c> will fail with
	  an <c>{erpc, badarg}</c> exception if/when an invalid
	  <c><anno>RequestId</anno></c> is detected.
	</p>
	<p>
	  If the <c>erpc</c> operation fails, but it is unknown if
	  the function is/will be applied (that is, a connection loss),
	  the caller will not receive any further information about the
	  result if/when the applied function completes. If the applied
	  function explicitly communicates with the calling process,
	  such communication may, of course, reach the calling process.
        </p>
      </desc>
    </func>

    <func>
      <name name="check_response" arity="3" since="OTP 25.0"/>
      <fsummary>Check if a message is a response corresponding to a
      previously sent call request.</fsummary>
      <desc>
        <p>
	  Check if a message is a response to a <c>call</c> request corresponding
          to a request identifier saved in <c><anno>RequestIdCollection</anno></c>.
          All request identifiers of <c><anno>RequestIdCollection</anno></c> must
          correspond to requests that have been made using
	  <seemfa marker="#send_request/4"><c>send_request/4</c></seemfa> or
	  <seemfa marker="#send_request/6"><c>send_request/6</c></seemfa>,
          and all requests must have been made by the process calling this
          function.
	</p>
        <p>
          <c><anno>Label</anno></c> is the label associated with the request
          identifier of the request that the response corresponds to.
          A request identifier is associated with a label when
          <seemfa marker="#reqids_add/3">adding a request identifier</seemfa>
          in a <seetype marker="#request_id_collection">request identifier
          collection</seetype>, or when sending the request using
          <seemfa marker="#send_request/6"><c>send_request/6</c></seemfa>.
        </p>
        <p>
          Compared to
          <seemfa marker="#check_response/2"><c>check_response/2</c></seemfa>,
          the returned result associated with a specific request identifier
          or an exception associated with a specific request identifier will
          be wrapped in a 3-tuple. The first element of this tuple equals the
          value that would have been produced by <c>check_response/2</c>,
          the second element equals the <c><anno>Label</anno></c> associated
          with the specific request identifier, and the third element
          <c><anno>NewRequestIdCollection</anno></c> is a possibly  modified
          request identifier collection. The <c>error</c> exception <c>{erpc,
          badarg}</c> is not associated with any specific request identifier,
          and will hence not be wrapped.
        </p>
        <p>
          If <c><anno>RequestIdCollection</anno></c> is empty, the atom
          <c>no_request</c> will be returned. If <c><anno>Message</anno></c>
          does not correspond to any of the request identifiers in
          <c><anno>RequestIdCollection</anno></c>, the atom
          <c>no_response</c> is returned.
        </p>
        <p>
          If <c><anno>Delete</anno></c> equals <c>true</c>, the association
          with <c><anno>Label</anno></c> will have been deleted from
          <c><anno>RequestIdCollection</anno></c> in the resulting
          <c><anno>NewRequestIdCollection</anno></c>. If
          <c><anno>Delete</anno></c> equals <c>false</c>,
          <c><anno>NewRequestIdCollection</anno></c> will equal
          <c><anno>RequestIdCollection</anno></c>. Note that deleting an
          association is not for free and that a collection containing
          already handled requests can still be used by subsequent calls to
          <c>check_response/3</c>,
 	  <seemfa marker="#receive_response/3"><c>receive_response/3</c></seemfa>,
          and
	  <seemfa marker="#wait_response/3"><c>wait_response/3</c></seemfa>.
          However, without deleting handled associations, the above calls will
          not be able to detect when there are no more outstanding requests to
          handle, so you will have to keep track of this some other way than
          relying on a <c>no_request</c> return. Note that if you pass a
          collection only containing associations of already handled or
          abandoned requests to <c>check_response/3</c>, it will always
          return <c>no_response</c>.
        </p>
        <p>
          Note that a response might have been consumed uppon an <c>{erpc,
          badarg}</c> exception and if so, will be lost for ever.
        </p>
      </desc>
    </func>

    <func>
      <name name="multicall" arity="2" since="OTP 23.0"/>
      <name name="multicall" arity="3" since="OTP 23.0"/>
      <fsummary>Evaluate a function call on a node.</fsummary>
      <desc>
	<p>
	  The same as calling
	  <seemfa marker="#multicall/5"><c>erpc:multicall(<anno>Nodes</anno>,
          erlang, apply, [<anno>Fun</anno>,[]], <anno>Timeout</anno>)</c></seemfa>.
	  May raise all the same exceptions as <c>multicall/5</c>
	  plus an <c>{erpc, badarg}</c> <c>error</c>
	  exception if <c><anno>Fun</anno></c> is not a fun of
	  zero arity.
	</p>
	<p>
	  The call <c>erpc:multicall(<anno>Nodes</anno>,<anno>Fun</anno>)</c>
	  is the same as the call
	  <c>erpc:multicall(<anno>Nodes</anno>,<anno>Fun</anno>, infinity)</c>.
	</p>
      </desc>
    </func>

    <func>
      <name name="multicall" arity="4" since="OTP 23.0"/>
      <name name="multicall" arity="5" since="OTP 23.0"/>
      <fsummary>Evaluate a function call on a number of nodes.</fsummary>
      <type name="caught_call_exception"/>
      <type name="stack_item"/>
      <desc>
	<p>
	  Performs multiple <c>call</c> operations in parallel
	  on multiple nodes. That is, evaluates
	  <c>apply(<anno>Module</anno>, <anno>Function</anno>,
          <anno>Args</anno>)</c> on the nodes <c><anno>Nodes</anno></c>
          in parallel. <c><anno>Timeout</anno></c> sets an upper time
          limit for all <c>call</c> operations to complete. The result
          is returned as a list where the result from each node is placed
          at the same position as the node name is placed in
          <c><anno>Nodes</anno></c>. Each item in the resulting list is
          formatted as either:
	</p>
	<taglist>
	  <tag><c>{ok, Result}</c></tag>
	  <item><p>
	    The <c>call</c> operation for this specific node
	    returned <c>Result</c>.
	  </p></item>
	  <tag><c>{Class, ExceptionReason}</c></tag>
	  <item><p>
	    The <c>call</c> operation for this specific node
	    raised an exception of class <c>Class</c> with
	    exception reason <c>ExceptionReason</c>. These
	    correspond to the exceptions that
	    <seemfa marker="#call/5"><c>call/5</c></seemfa>
	    can raise.
	  </p></item>
	</taglist>
	<p><c>multicall/5</c> fails with an <c>{erpc, badarg}</c>
	<c>error</c> exception if:</p>
	<list>
	  <item><p><c><anno>Nodes</anno></c> is not a proper list of
	  atoms. Note that some requests may already have
	  been sent when the failure occurs. That is, the function
	  may or may not be applied on some nodes.</p></item>
	  <item><p><c><anno>Module</anno></c> is not an atom.</p></item>
	  <item><p><c><anno>Function</anno></c> is not an atom.</p></item>
	  <item><p><c><anno>Args</anno></c> is not a list. Note that the
	  list is not verified to be a proper list at the client side.</p></item>
	</list>
	<p>
	  The call <c>erpc:multicall(<anno>Nodes</anno>, <anno>Module</anno>,
	  <anno>Function</anno>, <anno>Args</anno>)</c> is equivalent
	  to the call <c>erpc:multicall(<anno>Nodes</anno>, <anno>Module</anno>,
	  <anno>Function</anno>, <anno>Args</anno>, infinity)</c>. These
	  calls are also equivalent to calling <c>my_multicall(Nodes, Module,
	  Function, Args)</c> below if one disregard performance and failure
	  behavior. <c>multicall()</c> can utilize a selective receive
          optimization which removes the need to scan the message queue from
          the beginning in order to find a matching message. The
	  <c>send_request()/receive_response()</c> combination can,
          however, not utilize this optimization.
	</p>
	<pre>
my_multicall(Nodes, Module, Function, Args) ->
  ReqIds = lists:map(fun (Node) ->
                       <seemfa marker="#send_request/4">erpc:send_request(Node, Module, Function, Args)</seemfa>
                     end,
                     Nodes),
  lists:map(fun (ReqId) ->
              try
                {ok, <seemfa marker="#receive_response/2">erpc:receive_response(ReqId, infinity)</seemfa>}
              catch
                Class:Reason ->
                  {Class, Reason}
              end
            end,
            ReqIds).
</pre>

	<p>
	  If an <c>erpc</c> operation fails, but it is unknown if
	  the function is/will be applied (that is, a timeout,
	  connection loss, or an improper <c><anno>Nodes</anno></c>
	  list), the caller will not receive any further information
	  about the result if/when the applied function completes.
	  If the applied function communicates
	  with the calling process, such communication may, of
	  course, reach the calling process.
	</p>

	<note>
	  <p>
	    You cannot make <em>any</em> assumptions about the
	    process that will perform the <c>apply()</c>. It may
	    be the calling process itself, a server, or a freshly
	    spawned process.
	  </p>
	</note>
      </desc>
      
    </func>

    <func>
      <name name="multicast" arity="2" since="OTP 23.0"/>
      <fsummary>Evaluate a function call on a set nodes.</fsummary>
      <desc>
	<p>
	  The same as calling
	  <seemfa marker="#multicast/4"><c>erpc:multicast(<anno>Nodes</anno>,erlang,apply,[<anno>Fun</anno>,[]])</c></seemfa>.
	</p>
	<p><c>multicast/2</c> fails with an <c>{erpc, badarg}</c>
	<c>error</c> exception if:</p>
	<list>
	  <item><p><c><anno>Nodes</anno></c> is not a proper list of atoms.</p></item>
	  <item><p><c><anno>Fun</anno></c> is not a a fun of zero arity.</p></item>
	</list>
      </desc>
    </func>

    <func>
      <name name="multicast" arity="4" since="OTP 23.0"/>
      <fsummary>Evaluate a function call on a set of nodes ignoring the result.</fsummary>
      <desc>
        <p>
	  Evaluates <c>apply(<anno>Module</anno>, <anno>Function</anno>,
          <anno>Args</anno>)</c> on the nodes
          <c><anno>Nodes</anno></c>. No response is delivered to the
	  calling process. <c>multicast()</c> returns immediately
	  after the cast requests have been sent. Any failures beside
	  bad arguments are silently ignored.
	</p>
	<p><c>multicast/4</c> fails with an <c>{erpc, badarg}</c>
	<c>error</c> exception if:</p>
	<list>
	  <item><p><c><anno>Nodes</anno></c> is not a proper list of
	  atoms. Note that some requests may already have
	  been sent when the failure occurs. That is, the function
	  may or may not be applied on some nodes.</p></item>
	  <item><p><c><anno>Module</anno></c> is not an atom.</p></item>
	  <item><p><c><anno>Function</anno></c> is not an atom.</p></item>
	  <item><p><c><anno>Args</anno></c> is not a list. Note that the
	  list is not verified to be a proper list at the client side.</p></item>
	</list>
	<note>
	  <p>
	    You cannot make <em>any</em> assumptions about the
	    process that will perform the <c>apply()</c>. It may
	    be a server, or a freshly spawned process.
	  </p>
	</note>
      </desc>
    </func>

    <func>
      <name name="receive_response" arity="1" since="OTP 23.0"/>
      <fsummary>Receive a call response corresponding to a
      previously sent call request.</fsummary>
      <desc>
        <p>
          The same as calling
          <seemfa marker="#receive_response/2"><c>erpc:receive_response(<anno>RequestId</anno>,
          infinity)</c></seemfa>.
        </p>
      </desc>
    </func>

    <func>
      <name name="receive_response" arity="2" since="OTP 23.0"/>
      <fsummary>Receive a call response corresponding to a
      previously sent call request.</fsummary>
      <desc>
	<p>
	  Receive a response to a <c>call</c> request previously
	  made by the calling process using
	  <seemfa marker="#send_request/4"><c>send_request/4</c></seemfa>.
	  <c><anno>RequestId</anno></c> should be the value returned from
	  the previously made <c>send_request/4</c> call, and
	  the corresponding response should not already have been received
	  and handled to completion by <c>receive_response()</c>,
	  <seemfa marker="#check_response/2"><c>check_response/4</c></seemfa>,
          or
	  <seemfa marker="#wait_response/2"><c>wait_response/4</c></seemfa>.
        </p>
        <p>
          <c><anno>Timeout</anno></c> sets an upper time limit on how
          long to wait for a response. If the operation times out, the request
          identified by <c><anno>RequestId</anno></c> will be abandoned, then an
          <c>{erpc, timeout}</c> <c>error</c> exception will be raised. That is,
          no response corresponding to the request will ever be received after a
          timeout. If a response is received, the <c>call</c> operation is
          completed and either the result is returned or an exception is raised. The
          exceptions that can be raised corresponds to the same exceptions as can
          be raised by <seemfa marker="#call/5"><c>call/5</c></seemfa>.
	  <c>receive_response/2</c> will fail with an <c>{erpc, badarg}</c>
	  exception if/when an invalid <c><anno>RequestId</anno></c> is detected
	  or if an invalid <c><anno>Timeout</anno></c> is passed.
	</p>

	<p>
	  A call to the function
	  <c>my_call(Node, Module, Function, Args, Timeout)</c>
	  below is equivalent to the call
	  <seemfa marker="#call/5"><c>erpc:call(Node, Module, Function, Args,
	  Timeout)</c></seemfa> if one disregards performance. <c>call()</c>
	  can utilize a selective receive optimization which removes
          the need to scan the message queue from the beginning in
          order to find a matching message. The
	  <c>send_request()/receive_response()</c> combination can,
          however, not utilize this optimization.
	</p>
	<pre>
my_call(Node, Module, Function, Args, Timeout) ->
  RequestId = <seemfa marker="#send_request/4">erpc:send_request(Node, Module, Function, Args)</seemfa>,
  erpc:receive_response(RequestId, Timeout).
</pre>
	<p>
	  If the <c>erpc</c> operation fails, but it is unknown if
	  the function is/will be applied (that is, a timeout, or
	  a connection loss), the caller will not receive any
	  further information about the result if/when the applied
	  function completes. If the applied function explicitly
	  communicates with the calling process, such communication
	  may, of course, reach the calling process.
        </p>
      </desc>
    </func>

    <func>
      <name name="receive_response" arity="3" since="OTP 25.0"/>
      <fsummary>Receive a call response corresponding to a
      previously sent call request.</fsummary>
      <desc>
        <p>
	  Receive a response to a <c>call</c> request corresponding to a request
          identifier saved in <c><anno>RequestIdCollection</anno></c>. All
          request identifiers of <c><anno>RequestIdCollection</anno></c> must
          correspond to requests that have been made using
	  <seemfa marker="#send_request/4"><c>send_request/4</c></seemfa> or
	  <seemfa marker="#send_request/6"><c>send_request/6</c></seemfa>,
          and all requests must have been made by the process calling this
          function.
	</p>
        <p>
          <c><anno>Label</anno></c> is the label associated with the request
          identifier of the request that the response corresponds to.
          A request identifier is associated with a label when
          <seemfa marker="#reqids_add/3">adding a request identifier</seemfa>
          in a <seetype marker="#request_id_collection">request identifier
          collection</seetype>, or when sending the request using
          <seemfa marker="#send_request/6"><c>send_request/6</c></seemfa>.
        </p>
        <p>
          Compared to
          <seemfa marker="#receive_response/2"><c>receive_response/2</c></seemfa>,
          the returned result associated with a specific request identifier
          or an exception associated with a specific request identifier will
          be wrapped in a 3-tuple. The first element of this tuple equals the
          value that would have been produced by <c>receive_response/2</c>,
          the second element equals the <c><anno>Label</anno></c> associated
          with the specific request identifier, and the third element
          <c><anno>NewRequestIdCollection</anno></c> is a possibly  modified
          request identifier collection. The <c>error</c> exceptions <c>{erpc,
          badarg}</c> and <c>{erpc, timeout}</c> are not associated with any
          specific request identifiers, and will hence not be wrapped.
        </p>
        <p>
          If <c><anno>RequestIdCollection</anno></c> is empty, the atom
          <c>no_request</c> will be returned.
        </p>
        <p>
          If the operation times out, all requests identified by
          <c><anno>RequestIdCollection</anno></c> will be abandoned, then an
          <c>{erpc, timeout}</c> <c>error</c> exception will be raised. That is,
          no responses corresponding to any of the request identifiers in
          <c><anno>RequestIdCollection</anno></c> will ever be received after a
          timeout. The difference between <c>receive_response/3</c> and
          <seemfa marker="#wait_response/3"><c>wait_response/3</c></seemfa>
          is that <c>receive_response/3</c> abandons the requests at timeout
          so that any potential future responses are ignored, while
          <c>wait_response/3</c> does not.
	</p>
        <p>
          If <c><anno>Delete</anno></c> equals <c>true</c>, the association
          with <c><anno>Label</anno></c> will have been deleted from
          <c><anno>RequestIdCollection</anno></c> in the resulting
          <c><anno>NewRequestIdCollection</anno></c>. If
          <c><anno>Delete</anno></c> equals <c>false</c>,
          <c><anno>NewRequestIdCollection</anno></c> will equal
          <c><anno>RequestIdCollection</anno></c>. Note that deleting an
          association is not for free and that a collection containing
          already handled requests can still be used by subsequent calls to
          <c>receive_response/3</c>,
 	  <seemfa marker="#check_response/3"><c>check_response/3</c></seemfa>,
          and
	  <seemfa marker="#wait_response/3"><c>wait_response/3</c></seemfa>.
          However, without deleting handled associations, the above calls will
          not be able to detect when there are no more outstanding requests to
          handle, so you will have to keep track of this some other way than
          relying on a <c>no_request</c> return. Note that if you pass a
          collection only containing associations of already handled or
          abandoned requests to <c>receive_response/3</c>, it will always block
          until a timeout determined by <c><anno>Timeout</anno></c> is
          triggered.
        </p>
        <p>
          Note that a response might have been consumed uppon an <c>{erpc,
          badarg}</c> exception and if so, will be lost for ever.
        </p>
      </desc>
    </func>
    
    <func>
      <name name="reqids_add" arity="3" since="OTP 25.0"/>
      <fsummary>Save a request identifier.</fsummary>
      <desc>
	<p>
          Saves <c><anno>RequestId</anno></c> and associates a
          <c><anno>Label</anno></c> with the request identifier by adding this
          information to <c><anno>RequestIdCollection</anno></c> and returning
          the resulting request identifier collection.
        </p>
      </desc>
    </func>

    <func>
      <name name="reqids_new" arity="0" since="OTP 25.0"/>
      <fsummary>Create a new empty request identifier collection.</fsummary>
      <desc>
	<p>
          Returns a new empty request identifier collection. A 
          request identifier collection can be utilized in order
          the handle multiple outstanding requests.
        </p>
        <p>
          Request identifiers of requests made by
	  <seemfa marker="#send_request/4"><c>send_request/4</c></seemfa>
          can be saved in a request identifier collection using 
	  <seemfa marker="#reqids_add/3"><c>reqids_add/3</c></seemfa>.
          Such a collection of request identifiers can later be used in
          order to get one response corresponding to a request in the
          collection by passing the collection as argument to
          <seemfa marker="#check_response/3"><c>check_response/3</c></seemfa>,
	  <seemfa marker="#receive_response/3"><c>receive_response/3</c></seemfa>,
          and
	  <seemfa marker="#wait_response/3"><c>wait_response/3</c></seemfa>.
        </p>
        <p>
          <seemfa marker="#reqids_size/1"><c>reqids_size/1</c></seemfa>
          can be used to determine the amount of request identifiers in a
          request identifier collection.
        </p>
      </desc>
    </func>

    <func>
      <name name="reqids_size" arity="1" since="OTP 25.0"/>
      <fsummary>Get size of a request identifier collection.</fsummary>
      <desc>
	<p>
          Returns the amount of request identifiers saved in
          <c><anno>RequestIdCollection</anno></c>.
        </p>
      </desc>
    </func>

    <func>
      <name name="reqids_to_list" arity="1" since="OTP 25.0"/>
      <fsummary>Get a list a request identifier/label associations in a collection.</fsummary>
      <desc>
	<p>
          Returns a list of <c>{<anno>RequestId</anno>, <anno>Label</anno>}</c>
          tuples which corresponds to all request identifiers with their
          associated labels present in the <c><anno>RequestIdCollection</anno></c>
          collection.
        </p>
      </desc>
    </func>

    <func>
      <name name="send_request" arity="2" since="OTP 23.0"/>
      <fsummary>Send a request to evaluate a function call on a node.</fsummary>
      <desc>
	<p>
	  The same as calling
	  <seemfa marker="#send_request/4"><c>erpc:send_request(<anno>Node</anno>,
          erlang, apply, [<anno>Fun</anno>, []])</c></seemfa>.
	</p>
	<p>Fails with an <c>{erpc, badarg}</c> <c>error</c> exception if:</p>
	<list>
	  <item><p><c><anno>Node</anno></c> is not an atom.</p></item>
	  <item><p><c><anno>Fun</anno></c> is not a fun of
	  zero arity.</p></item>
	</list>
	<note>
	  <p>
	    You cannot make <em>any</em> assumptions about the
	    process that will perform the <c>apply()</c>. It may
	    be a server, or a freshly spawned process.
	  </p>
	</note>
      </desc>
    </func>
    
    <func>
      <name name="send_request" arity="4" clause_i="1" since="OTP 23.0"/>
      <fsummary>Send a request to evaluate a function call on a node.</fsummary>
      <desc>
	<p>
	  Send an asynchronous <c>call</c> request to the node
	  <c><anno>Node</anno></c>. <c>send_request/4</c>
	  returns a request identifier that later is to be passed
	  to either
	  <seemfa marker="#receive_response/2"><c>receive_response/2</c></seemfa>,
	  <seemfa marker="#wait_response/2"><c>wait_response/2</c></seemfa>,
	  or,
	  <seemfa marker="#check_response/2"><c>check_response/2</c></seemfa>
	  in order to get the response of the call request. Besides passing
          the request identifier directly to these functions, it can also be
          added in a request identifier collection using 
	  <seemfa marker="#reqids_add/3"><c>reqids_add/3</c></seemfa>.
          Such a collection of request identifiers can later be used in
          order to get one response corresponding to a request in the
          collection by passing the collection as argument to
	  <seemfa marker="#receive_response/3"><c>receive_response/3</c></seemfa>,
	  <seemfa marker="#wait_response/3"><c>wait_response/3</c></seemfa>,
	  or,
	  <seemfa marker="#check_response/3"><c>check_response/3</c></seemfa>.
          If you are about to save the request identifier in a request identifier
          collection, you may want to consider using
          <seemfa marker="#send_request/6"><c>send_request/6</c></seemfa>
          instead.
        </p>
        <p>
	  A call to the function
	  <c>my_call(Node, Module, Function, Args, Timeout)</c>
	  below is equivalent to the call
	  <seemfa marker="#call/5"><c>erpc:call(Node, Module, Function, Args,
	  Timeout)</c></seemfa> if one disregards performance. <c>call()</c>
	  can utilize a selective receive optimization which removes
          the need to scan the message queue from the beginning in
          order to find a matching message. The
	  <c>send_request()/receive_response()</c> combination can,
          however, not utilize this optimization.
	</p>
	<pre>
my_call(Node, Module, Function, Args, Timeout) ->
  RequestId = erpc:send_request(Node, Module, Function, Args),
  <seemfa marker="#receive_response/2">erpc:receive_response(RequestId, Timeout)</seemfa>.
</pre>
	<p>Fails with an <c>{erpc, badarg}</c> <c>error</c> exception if:</p>
	<list>
	  <item><p><c><anno>Node</anno></c> is not an atom.</p></item>
	  <item><p><c><anno>Module</anno></c> is not an atom.</p></item>
	  <item><p><c><anno>Function</anno></c> is not an atom.</p></item>
	  <item><p><c><anno>Args</anno></c> is not a list. Note that the
	  list is not verified to be a proper list at the client side.</p></item>
	</list>
	<note>
	  <p>
	    You cannot make <em>any</em> assumptions about the
	    process that will perform the <c>apply()</c>. It may
	    be a server, or a freshly spawned process.
	  </p>
	</note>
      </desc>
    </func>

    <func>
      <name name="send_request" arity="4" clause_i="2" since="OTP 25.0"/>
      <fsummary>Send a request to evaluate a function call on a node.</fsummary>
      <desc>
	<p>
	  The same as calling
	  <seemfa marker="#send_request/6"><c>erpc:send_request(<anno>Node</anno>,
          erlang, apply, [<anno>Fun</anno>,[]]), <anno>Label</anno>,
          <anno>RequestIdCollection</anno>)</c></seemfa>.
	</p>
	<p>Fails with an <c>{erpc, badarg}</c> <c>error</c> exception if:</p>
	<list>
	  <item><p><c><anno>Node</anno></c> is not an atom.</p></item>
	  <item><p><c><anno>Fun</anno></c> is not a fun of zero arity.</p></item>
	  <item><p><c><anno>RequestIdCollection</anno></c> is detected not to
          be request identifier collection.</p></item>
	</list>
	<note>
	  <p>
	    You cannot make <em>any</em> assumptions about the
	    process that will perform the <c>apply()</c>. It may
	    be a server, or a freshly spawned process.
	  </p>
	</note>
      </desc>
    </func>

    <func>
      <name name="send_request" arity="6" since="OTP 25.0"/>
      <fsummary>Send a request to evaluate a function call on a node.</fsummary>
      <desc>
	<p>
	  Send an asynchronous <c>call</c> request to the node
	  <c><anno>Node</anno></c>. The <c><anno>Label</anno></c> will be
          associated with the request identifier of the operation and
          added to the returned request identifier collection
          <c><anno>NewRequestIdCollection</anno></c>. The collection can
          later be used in order to get one response corresponding to a
          request in the collection by passing the collection as argument to
	  <seemfa marker="#receive_response/3"><c>receive_response/3</c></seemfa>,
	  <seemfa marker="#wait_response/3"><c>wait_response/3</c></seemfa>,
	  or,
	  <seemfa marker="#check_response/3"><c>check_response/3</c></seemfa>.
        </p>

        <p>
          The same as calling
          <seemfa marker="#reqids_add/3"><c>erpc:reqids_add</c></seemfa>(<seemfa
          marker="#send_request/4"><c>erpc:send_request</c></seemfa><c>(<anno>Node</anno>,
          <anno>Module</anno>, <anno>Function</anno>, <anno>Args</anno>),
          <anno>Label</anno>, <anno>RequestIdCollection</anno>)</c>, but
          calling <c>send_request/6</c> is slightly more efficient.
        </p>

	<p>Fails with an <c>{erpc, badarg}</c> <c>error</c> exception if:</p>
	<list>
	  <item><p><c><anno>Node</anno></c> is not an atom.</p></item>
	  <item><p><c><anno>Module</anno></c> is not an atom.</p></item>
	  <item><p><c><anno>Function</anno></c> is not an atom.</p></item>
	  <item><p><c><anno>Args</anno></c> is not a list. Note that the
	  list is not verified to be a proper list at the client side.</p></item>
	  <item><p><c><anno>RequestIdCollection</anno></c> is detected not to
          be request identifier collection.</p></item>
	</list>
	<note>
	  <p>
	    You cannot make <em>any</em> assumptions about the
	    process that will perform the <c>apply()</c>. It may
	    be a server, or a freshly spawned process.
	  </p>
	</note>
      </desc>
    </func>

    <func>
      <name name="wait_response" arity="1" clause_i="1" since="OTP 23.0"/>
      <fsummary>Poll for a call response corresponding to a previously
      sent call request.</fsummary>
      <desc>
        <p>
          The same as calling
          <seemfa marker="#wait_response/2"><c>erpc:wait_response(<anno>RequestId</anno>,
          0)</c></seemfa>. That is, poll for a response message to a <c>call</c>
          request previously made by the calling process.
        </p>
      </desc>
    </func>

    <func>
      <name name="wait_response" arity="2" since="OTP 23.0"/>
      <fsummary>Wait or poll for a call response corresponding to a previously
      sent call request.</fsummary>
      <desc>
	<p>
	  Wait or poll for a response message to a <c>call</c> request
	  previously made by the calling process using
	  <seemfa marker="#send_request/4"><c>send_request/4</c></seemfa>.
	  <c><anno>RequestId</anno></c> should be the value returned from
	  the previously made <c>send_request()</c> call, and the
	  corresponding response should not already have been received and handled
	  to completion by
	  <seemfa marker="#check_response/2"><c>check_response/2</c></seemfa>,
	  <seemfa marker="#receive_response/2"><c>receive_response/2</c></seemfa>,
	  or <c>wait_response()</c>.
	</p>
	<p>
          <c><anno>WaitTime</anno></c> sets an upper time limit on how long to wait
          for a response. If no response is received before the
          <c><anno>WaitTime</anno></c> timeout has triggered, the atom
          <c>no_response</c> is returned. It is valid to continue waiting for a
          response as many times as needed up until a response has been received
          and completed by <c>check_response()</c>, <c>receive_response()</c>, or
          <c>wait_response()</c>. If a response is received, the <c>call</c>
          operation is completed and either the result is returned as
          <c>{response, Result}</c> where <c>Result</c> corresponds to the value
          returned from the applied function or an exception is raised. The
          exceptions that can be raised corresponds to the same exceptions as can
          be raised by <seemfa marker="#call/4"><c>call/4</c></seemfa>.
	  That is, no <c>{erpc, timeout}</c> <c>error</c> exception can be raised.
	  <c>wait_response/2</c> will fail with an <c>{erpc, badarg}</c>
	  exception if/when an invalid <c><anno>RequestId</anno></c> is detected
	  or if an invalid <c><anno>WaitTime</anno></c> is passed.
	</p>
	<p>
	  If the <c>erpc</c> operation fails, but it is unknown if
	  the function is/will be applied (that is, a too large wait time
	  value, or a connection loss), the caller will not receive any
	  further information about the result if/when the applied function
	  completes. If the applied function explicitly communicates with the
	  calling process, such communication may, of course, reach the
	  calling process.
        </p>
      </desc>
    </func>

    <func>
      <name name="wait_response" arity="3" since="OTP 25.0"/>
      <fsummary>Wait or poll for a call response corresponding to a previously
      sent call request.</fsummary>
      <desc>
        <p>
	  Wait or poll for a response to a <c>call</c> request corresponding
          to a request identifier saved in <c><anno>RequestIdCollection</anno></c>. All
          request identifiers of <c><anno>RequestIdCollection</anno></c> must
          correspond to requests that have been made using
	  <seemfa marker="#send_request/4"><c>send_request/4</c></seemfa> or
	  <seemfa marker="#send_request/6"><c>send_request/6</c></seemfa>,
          and all requests must have been made by the process calling this
          function.
	</p>
        <p>
          <c><anno>Label</anno></c> is the label associated with the request
          identifier of the request that the response corresponds to.
          A request identifier is associated with a label when
          <seemfa marker="#reqids_add/3">adding a request identifier</seemfa>
          in a <seetype marker="#request_id_collection">request identifier
          collection</seetype>, or when sending the request using
          <seemfa marker="#send_request/6"><c>send_request/6</c></seemfa>.
        </p>
        <p>
          Compared to
          <seemfa marker="#wait_response/2"><c>wait_response/2</c></seemfa>,
          the returned result associated with a specific request identifier
          or an exception associated with a specific request identifier will
          be wrapped in a 3-tuple. The first element of this tuple equals the
          value that would have been produced by <c>wait_response/2</c>,
          the second element equals the <c><anno>Label</anno></c> associated
          with the specific request identifier, and the third element
          <c><anno>NewRequestIdCollection</anno></c> is a possibly  modified
          request identifier collection. The <c>error</c> exception <c>{erpc,
          badarg}</c> is not associated with any specific request identifier,
          and will hence not be wrapped.
        </p>
        <p>
          If <c><anno>RequestIdCollection</anno></c> is empty, <c>no_request</c>
          will be returned. If no response is received before the
          <c><anno>WaitTime</anno></c> timeout has triggered, the atom
          <c>no_response</c> is returned. It is valid to continue waiting for a
          response as many times as needed up until a response has been received
          and completed by <c>check_response()</c>, <c>receive_response()</c>,
          or <c>wait_response()</c>. The difference between
          <seemfa marker="#receive_response/3"><c>receive_response/3</c></seemfa>
	  and <c>wait_response/3</c> is that <c>receive_response/3</c>
	  abandons requests at timeout so that any potential future
	  responses are ignored, while <c>wait_response/3</c> does not.
        </p>
        <p>
          If <c><anno>Delete</anno></c> equals <c>true</c>, the association
          with <c><anno>Label</anno></c> will have been deleted from
          <c><anno>RequestIdCollection</anno></c> in the resulting
          <c><anno>NewRequestIdCollection</anno></c>. If
          <c><anno>Delete</anno></c> equals <c>false</c>,
          <c><anno>NewRequestIdCollection</anno></c> will equal
          <c><anno>RequestIdCollection</anno></c>. Note that deleting an
          association is not for free and that a collection containing
          already handled requests can still be used by subsequent calls to
          <c>wait_response/3</c>,
 	  <seemfa marker="#check_response/3"><c>check_response/3</c></seemfa>,
          and
	  <seemfa marker="#receive_response/3"><c>receive_response/3</c></seemfa>.
          However, without deleting handled associations, the above calls will
          not be able to detect when there are no more outstanding requests to
          handle, so you will have to keep track of this some other way than
          relying on a <c>no_request</c> return. Note that if you pass a
          collection only containing associations of already handled or
          abandoned requests to <c>wait_response/3</c>, it will always block
          until a timeout determined by <c><anno>WaitTime</anno></c> is
          triggered and then return <c>no_response</c>.
        </p>
        <p>
          Note that a response might have been consumed uppon an <c>{erpc,
          badarg}</c> exception and if so, will be lost for ever.
        </p>
      </desc>
    </func>
    
  </funcs>
</erlref>