infinispan / js-client

Javascript client for Infinispan, over the Hot Rod wire protocol
https://infinispan.org/docs/hotrod-clients/js/latest/js_client.html
Apache License 2.0
15 stars 28 forks source link

code-refactored and added support of basic data types to protobuf encoder and decoder #88

Closed NeerajGartia21 closed 2 years ago

NeerajGartia21 commented 2 years ago

In this PR code is refactored

Functional programming is a paradigm of building computer programs using expressions and functions without mutating state and data. In the previous two PRs, the code added was only on implementing the new feature(added support of protobuf encoded cache) but the code wasn't written in functional programming style.This PR is based on re-factoring the code in a functional programming paradigm.The protobuf encoder and decoder for shipped to codec for reusability.

Also till now, basic datatypes are not supported as mediaTypes for the cache configured in application/x-protostream (only protobuf message instances are supported). This PR extends the protobuf encoder and decoder to support basic datatypes also.

Now integer, string , character , boolean can be used as key or values for cache configured with application/x-protostream.

Also tests for GET and PUT operations with basic datatypes are included.

Next task

rigazilla commented 2 years ago

merged thanks @NeerajGartia21 !