Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batches #3

Closed
bbkr opened this issue May 6, 2012 · 3 comments
Closed

Batches #3

bbkr opened this issue May 6, 2012 · 3 comments
Labels

Comments

@bbkr
Copy link
Owner

bbkr commented May 6, 2012

Spec

Exceptions won't be thrown on error, instead of that exception objects will be returned in result array.

This has to be implemented along with notifications, because notifications should be skipped in response batch while maintaining requests order.

Interface suggestion:

$client.rpc.batch.method_name("param");
$client.rpc.batch.rpc.notification.method_name("param"); # notification in batch
$client.rpc.batch.method_name("param");
my @results = $client.rpc.flush;
@bbkr
Copy link
Owner Author

bbkr commented Oct 18, 2012

Batches already works on Server side, commit 96504cc

On Client side syntax will be:

my $b = $client."rpc.batch"(); # get handle with batch context
$b.foo() # stack foo method call
$b.bar() # stack bar method call
my $result = $client."rpc.flush"();

Explanation:

According to spec method names that begin with "rpc." are reserved for internal processing. Quoted method "rpc.batch" must be used to avoid confusing with dispatch to "rpc" method, which is not internal.

Notifications in batches:

$b will be treated just the same as $client, so Notification can derive its own handle with notification handle from it

$b."rpc.notification"().foo() # stack foo notification in batch

@bbkr
Copy link
Owner Author

bbkr commented Oct 18, 2012

Reversing batch and notification context may also be allowed:

my $n = $client."rpc.notification"();
my $b = $n."rpc.batch"();
$b.foo(); $b.bar() ... # all methods stacked in batch will be notifications

@bbkr bbkr mentioned this issue Oct 18, 2012
@bbkr
Copy link
Owner Author

bbkr commented Dec 9, 2012

Implemented!

@bbkr bbkr closed this as completed Dec 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant