Coder Social home page Coder Social logo

neandertech / jsonrpclib Goto Github PK

View Code? Open in Web Editor NEW
17.0 3.0 4.0 139 KB

A cross-platform (JVM, JS, Native) pure-Scala JsonRPC library, made with Cats Effect, fs2, and jsoniter

License: Apache License 2.0

Scala 97.18% Shell 2.82%
cats-effect fs2 jsoniter-scala jsonrpc scala scala-native scalajs

jsonrpclib's Introduction

CI

jsonrpclib-fs2 Scala version support

jsonrpclib-fs2 Scala version support

jsonrpclib

This is a cross-platform, cross-scala-version library that provides construct for bidirectional communication using the jsonrpc protocol. It is built on top of fs2 and jsoniter-scala

This library does not enforce any transport, and can work on top of stdin/stdout or other channels.

Installation

The dependencies below are following cross-platform semantics. Adapt according to your needs

SBT

libraryDependencies += "tech.neander" %%% "jsonrpclib-fs2" % version

Mill

override def ivyDeps = super.ivyDeps() ++ Agg(ivy"tech.neander::jsonrpclib-fs2::$version")

Scala-cli

//> using lib "tech.neander::jsonrpclib-fs2:<VERSION>"

Usage

/!\ Please be aware that this library is in its early days and offers strictly no guarantee with regards to backward compatibility

See the examples folder

jsonrpclib's People

Contributors

baccata avatar ckipp01 avatar keynmol avatar mergify[bot] avatar neanderward[bot] avatar plokhotnyuk avatar ulugbekna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jsonrpclib's Issues

Make `core` fs2-specific

When I started this library, fs2 wasn't compiling to SN, and I had established a pretty arbitrary separation ... Standardising over fs2 would simplify some parts of the code a fair bit, and I'm not interested in implementing json-rpc for anything but fs2.

Update mill-tpolecat and publish

Just dropping this in here as a reminder once the Steward PR comes in. There was just a new release of mill-tpolecat that includes DavidGregory084/mill-tpolecat#18. The goal is to get the currently ignored libraries (including this one) removed from the filtered projects list in the community build https://github.com/VirtusLab/community-build3/blob/927f3751011d120c52a5217dfe8ccd3321f49c42/env/prod/config/filtered-projects.txt#L67-L69. Once that plugin is updated here with that fix I can remove it there.

CallId codec doesn't handle strings

Whereas I think it should, right?

//> using lib "tech.neander::jsonrpclib-fs2:0.0.3"

import com.github.plokhotnyuk.jsoniter_scala.core.*

@main def hello = 
  readFromStringReentrant[jsonrpclib.CallId]("25")
  readFromStringReentrant[jsonrpclib.CallId](""" "25" """.trim)
$ scli test.scala
Exception in thread "main" com.github.plokhotnyuk.jsoniter_scala.core.JsonReaderException: expected end of input, offset: 0x00000002, buf:
+----------+-------------------------------------------------+------------------+
|          |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f | 0123456789abcdef |
+----------+-------------------------------------------------+------------------+
| 00000000 | 22 32 35 22                                     | "25"             |
+----------+-------------------------------------------------+------------------+

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.