@@ -424,16 +424,17 @@ CloudI.API.prototype.mcast_async = function (name, request, callback,
424
424
425
425
CloudI . API . prototype . forward_ = function ( request_type , name ,
426
426
request_info , request ,
427
- timeout , priority , trans_id , pid ) {
427
+ timeout , priority ,
428
+ trans_id , source ) {
428
429
var API = this ;
429
430
switch ( request_type ) {
430
431
case API . ASYNC :
431
432
API . forward_async ( name , request_info , request ,
432
- timeout , priority , trans_id , pid ) ;
433
+ timeout , priority , trans_id , source ) ;
433
434
return ;
434
435
case API . SYNC :
435
436
API . forward_sync ( name , request_info , request ,
436
- timeout , priority , trans_id , pid ) ;
437
+ timeout , priority , trans_id , source ) ;
437
438
return ;
438
439
default :
439
440
throw new InvalidInputException ( ) ;
@@ -442,42 +443,42 @@ CloudI.API.prototype.forward_ = function (request_type, name,
442
443
443
444
CloudI . API . prototype . forward_async = function ( name , request_info , request ,
444
445
timeout , priority ,
445
- trans_id , pid ) {
446
+ trans_id , source ) {
446
447
this . _poll_wait ( function ( API ) {
447
448
API . _send ( [ new Erlang . OtpErlangAtom ( 'forward_async' ) , name ,
448
449
new Erlang . OtpErlangBinary ( request_info ) ,
449
450
new Erlang . OtpErlangBinary ( request ) ,
450
451
timeout , priority ,
451
- new Erlang . OtpErlangBinary ( trans_id ) , pid ] ) ;
452
+ new Erlang . OtpErlangBinary ( trans_id ) , source ] ) ;
452
453
throw new ForwardAsyncException ( ) ;
453
454
} ) ;
454
455
} ;
455
456
456
457
CloudI . API . prototype . forward_sync = function ( name , request_info , request ,
457
458
timeout , priority ,
458
- trans_id , pid ) {
459
+ trans_id , source ) {
459
460
this . _poll_wait ( function ( API ) {
460
461
API . _send ( [ new Erlang . OtpErlangAtom ( 'forward_sync' ) , name ,
461
462
new Erlang . OtpErlangBinary ( request_info ) ,
462
463
new Erlang . OtpErlangBinary ( request ) ,
463
464
timeout , priority ,
464
- new Erlang . OtpErlangBinary ( trans_id ) , pid ] ) ;
465
+ new Erlang . OtpErlangBinary ( trans_id ) , source ] ) ;
465
466
throw new ForwardSyncException ( ) ;
466
467
} ) ;
467
468
} ;
468
469
469
470
CloudI . API . prototype . return_ = function ( request_type , name , pattern ,
470
471
response_info , response ,
471
- timeout , trans_id , pid ) {
472
+ timeout , trans_id , source ) {
472
473
var API = this ;
473
474
switch ( request_type ) {
474
475
case API . ASYNC :
475
476
API . return_async ( name , pattern , response_info , response ,
476
- timeout , trans_id , pid ) ;
477
+ timeout , trans_id , source ) ;
477
478
return ;
478
479
case API . SYNC :
479
480
API . return_sync ( name , pattern , response_info , response ,
480
- timeout , trans_id , pid ) ;
481
+ timeout , trans_id , source ) ;
481
482
return ;
482
483
default :
483
484
throw new InvalidInputException ( ) ;
@@ -486,24 +487,24 @@ CloudI.API.prototype.return_ = function (request_type, name, pattern,
486
487
487
488
CloudI . API . prototype . return_async = function ( name , pattern ,
488
489
response_info , response ,
489
- timeout , trans_id , pid ) {
490
+ timeout , trans_id , source ) {
490
491
this . _poll_wait ( function ( API ) {
491
492
API . _send ( [ new Erlang . OtpErlangAtom ( 'return_async' ) , name , pattern ,
492
493
new Erlang . OtpErlangBinary ( response_info ) ,
493
494
new Erlang . OtpErlangBinary ( response ) ,
494
- timeout , new Erlang . OtpErlangBinary ( trans_id ) , pid ] ) ;
495
+ timeout , new Erlang . OtpErlangBinary ( trans_id ) , source ] ) ;
495
496
throw new ReturnAsyncException ( ) ;
496
497
} ) ;
497
498
} ;
498
499
499
500
CloudI . API . prototype . return_sync = function ( name , pattern ,
500
501
response_info , response ,
501
- timeout , trans_id , pid ) {
502
+ timeout , trans_id , source ) {
502
503
this . _poll_wait ( function ( API ) {
503
504
API . _send ( [ new Erlang . OtpErlangAtom ( 'return_sync' ) , name , pattern ,
504
505
new Erlang . OtpErlangBinary ( response_info ) ,
505
506
new Erlang . OtpErlangBinary ( response ) ,
506
- timeout , new Erlang . OtpErlangBinary ( trans_id ) , pid ] ) ;
507
+ timeout , new Erlang . OtpErlangBinary ( trans_id ) , source ] ) ;
507
508
throw new ReturnSyncException ( ) ;
508
509
} ) ;
509
510
} ;
@@ -569,13 +570,14 @@ CloudI.API.prototype.priority_default = function () {
569
570
CloudI . API . prototype . _null_response = function ( request_type , name , pattern ,
570
571
request_info , request ,
571
572
timeout , priority ,
572
- trans_id , pid ) {
573
+ trans_id , source ) {
573
574
return '' ;
574
575
} ;
575
576
576
577
CloudI . API . prototype . _callback = function ( command , name , pattern ,
577
578
request_info , request ,
578
- timeout , priority , trans_id , pid ) {
579
+ timeout , priority ,
580
+ trans_id , source ) {
579
581
var API = this ;
580
582
var function_queue = API . _callbacks [ pattern ] ;
581
583
var f ;
@@ -632,7 +634,7 @@ CloudI.API.prototype._callback = function (command, name, pattern,
632
634
try {
633
635
API . return_async ( name , pattern ,
634
636
response_info , response ,
635
- timeout , trans_id , pid ) ;
637
+ timeout , trans_id , source ) ;
636
638
}
637
639
catch ( err_new ) {
638
640
err_new = undefined ;
@@ -647,7 +649,8 @@ CloudI.API.prototype._callback = function (command, name, pattern,
647
649
var response = f . obj_f . call ( f . obj ,
648
650
API . ASYNC , name , pattern ,
649
651
request_info , request ,
650
- timeout , priority , trans_id , pid ) ;
652
+ timeout , priority ,
653
+ trans_id , source ) ;
651
654
if ( typeof response === 'undefined' ) {
652
655
return ;
653
656
}
@@ -670,7 +673,7 @@ CloudI.API.prototype._callback = function (command, name, pattern,
670
673
try {
671
674
API . return_async ( name , pattern ,
672
675
response_info , response ,
673
- timeout , trans_id , pid ) ;
676
+ timeout , trans_id , source ) ;
674
677
}
675
678
catch ( err_new ) {
676
679
err_new = undefined ;
@@ -722,7 +725,7 @@ CloudI.API.prototype._callback = function (command, name, pattern,
722
725
try {
723
726
API . return_sync ( name , pattern ,
724
727
response_info , response ,
725
- timeout , trans_id , pid ) ;
728
+ timeout , trans_id , source ) ;
726
729
}
727
730
catch ( err_new ) {
728
731
err_new = undefined ;
@@ -737,7 +740,8 @@ CloudI.API.prototype._callback = function (command, name, pattern,
737
740
var response = f . obj_f . call ( f . obj ,
738
741
API . SYNC , name , pattern ,
739
742
request_info , request ,
740
- timeout , priority , trans_id , pid ) ;
743
+ timeout , priority ,
744
+ trans_id , source ) ;
741
745
if ( typeof response === 'undefined' ) {
742
746
return ;
743
747
}
@@ -760,7 +764,7 @@ CloudI.API.prototype._callback = function (command, name, pattern,
760
764
try {
761
765
API . return_sync ( name , pattern ,
762
766
response_info , response ,
763
- timeout , trans_id , pid ) ;
767
+ timeout , trans_id , source ) ;
764
768
}
765
769
catch ( err_new ) {
766
770
err_new = undefined ;
@@ -887,15 +891,15 @@ CloudI.API.prototype._poll_request = function (data) {
887
891
j = i + 16 ;
888
892
var trans_id = data . slice ( i , j ) ;
889
893
i = j ;
890
- var pid_size = unpackUint32 ( i , data ) ;
894
+ var source_size = unpackUint32 ( i , data ) ;
891
895
i += 4 ;
892
- j = i + pid_size ;
893
- var pid = data . slice ( i , j ) ;
896
+ j = i + source_size ;
897
+ var source = data . slice ( i , j ) ;
894
898
i = j ;
895
899
if ( i != data_size ) {
896
900
API . _handle_events ( data , data_size , i ) ;
897
901
}
898
- Erlang . binary_to_term ( pid , function ( err , pid_object ) {
902
+ Erlang . binary_to_term ( source , function ( err , source_object ) {
899
903
if ( err ) {
900
904
API . _exception ( err ) ;
901
905
API . _poll_terminate ( ) ;
@@ -904,7 +908,7 @@ CloudI.API.prototype._poll_request = function (data) {
904
908
API . _callback ( command , name , pattern ,
905
909
request_info , request ,
906
910
request_timeout , priority ,
907
- trans_id , pid_object ) ;
911
+ trans_id , source_object ) ;
908
912
}
909
913
} ) ;
910
914
return ;
0 commit comments