Giter Site home page Giter Site logo

joffrey-bion / krossbow Goto Github PK

View Code? Open in Web Editor NEW
188.0 5.0 14.0 13.78 MB

A Kotlin multiplatform coroutine-based STOMP client over websockets, with built-in conversions.

License: MIT License

Kotlin 100.00%
kotlin multiplatform stomp stompwebsocket websocket client coroutines krossbow kotlinx-serialization web-socket

krossbow's Introduction

Krossbow

Maven central version Github Build GitHub license

See the project's website for documentation.

Krossbow is a Kotlin multiplatform STOMP 1.2 client with a coroutine-based API. It provides a bunch of adapters for popular web socket clients (OkHttp, Ktor, Spring, SockJS...), as well as a 0-dependency built-in web socket implementation for some platforms.

License

This project is published under the MIT license.

krossbow's People

Contributors

dependabot[bot] avatar dimitriz09 avatar github-actions[bot] avatar gradle-update-robot avatar jatsqi avatar joffrey-bion avatar remy-bardou-lifeonair avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

krossbow's Issues

Consider using ReceiveChannel for subscriptions

This would make code simpler on the consumer side.
Subscriptions could be canceled (unsubscribed from) using ReceiveChannel.cancel(), and iterations could natively be done without calling sub.messages.

Improve error handling

The web socket listener should never throw an exception, because we don't control who calls it (it's up to the underlying web socket implementation).

Instead, all sorts of errors triggered in the listener should end up in the execution flow of the STOMP session's user. This means failing the subscriptions channels and the pending calls to send().

LostReceiptException thrown on external timeout

Using withTimeout to wrap calls to the StompSession should be supported.

val client = StompClient {
    receiptTimeoutMillis = 10000
}
val stompSession = client.connect("ws://localhost:8000")
withTimeout(600) {
    stompSession.sendText("/dest", "message")
}

This timeout crashes with LostReceiptException while it should be TimeoutCancellationException. This is a user-generated timeout and should behave as a normal timeout with the regular exception.

Fix: use withTimeoutOrNull internally instead of catching the TimeoutCancellationException.

JS version not working

The tests have always been broken in JS but previous versions of the Kotlin plugin didn't show that. Now the tests are properly broken using Kotlin 1.3.60, and they need to be fixed.

Unify automated tests for all Web Socket adapters

We would either need to implement a test server on every platform (unlikely to be possible in the browser environment), or spawn a server next to the build in order to run the tests, but that would be pretty annoying.

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.