[infinispan-dev] Infinispan Javascript client 0.1.0 is out now!

Radim Vansa rvansa at redhat.com
Fri Feb 19 04:37:17 EST 2016


Err, I've omitted some closing parentheses, but the concept should be 
clear from indentation.

Also, you could omit the declaration of function(client) if you had a 
static object cache (rather than client here) and cache.put('key', 
'value') would return a function doing the put on provided client, 
rather than executing the operation directly.

R.

On 02/19/2016 10:31 AM, Radim Vansa wrote:
> Just checked the readme, and TBH I wouldn't be too enthusiastic about
> the deep nesting of chained operations (basically each follow-up
> operation requires further level of nesting). Is that the way async
> handlers are usually written in JS?
>
> Last few weeks I am working with Gatling and the syntax to describe
> scenarios = chained operations is quite nice (though it's Scala). Would
> it be possible to have a syntax like this?
>
> connected
>       .then(function(client) {
>           client.put('key', 'value');
>       .then(function(client) {
>           client.get('key').use(function(value) {
>               console.log(':get(`key`) = ' + value);
>           }).save('p0'); // this would be the same as use(function(value)
> { client.save('p0') })
>       }.
>       .then(function(client)) {
>           client.remove('key', client.load('p0')).use(function(success) {
>               console.log(':remove(`key`) = ' + success);
>           });
>       }).exec();
>
> Note that I've used conditional remove to demonstrate load of previously
> saved value. Also, I am mixing the concept of client = cache and
> session, but maybe these could go to single object.
>
> Just my 2c
>
> Radim
>
> On 02/18/2016 12:04 PM, Galder Zamarreño wrote:
>> Hi,
>>
>> Following on Tristan's anouncement, we've also released Infinispan Javascript client version 0.1.0. You can read all about it here:
>> http://blog.infinispan.org/2016/02/infinispan-javascript-client-010-is-out.html
>>
>> Cheers,
>> --
>> Galder Zamarreño
>> Infinispan, Red Hat
>>
>>
>> _______________________________________________
>> infinispan-dev mailing list
>> infinispan-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>


-- 
Radim Vansa <rvansa at redhat.com>
JBoss Performance Team



More information about the infinispan-dev mailing list