Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/colagom/kowet
implements STOMP protocol by websocket for KMM (WIP)
https://github.com/colagom/kowet
kotlin kotlin-multiplatform stomp websocket
Last synced: about 2 months ago
JSON representation
implements STOMP protocol by websocket for KMM (WIP)
- Host: GitHub
- URL: https://github.com/colagom/kowet
- Owner: ColaGom
- Created: 2022-03-19T07:57:48.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-07-29T17:24:46.000Z (over 2 years ago)
- Last Synced: 2024-12-18T23:43:37.476Z (about 2 months ago)
- Topics: kotlin, kotlin-multiplatform, stomp, websocket
- Language: Kotlin
- Homepage:
- Size: 178 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kowet
[![Maven Central](https://img.shields.io/maven-central/v/io.github.colagom/kowet.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.colagom%22%20AND%20a:%22kowet%22)KMM WebSocket support to STOMP protocol
# STOMP?
- https://stomp.github.io/stomp-specification-1.2.html# Usage
### Android
```kotlin
val ws = WebSocketFactory.create("ws://10.0.2.2:8081/connect/websocket")
// create session
val session = Stomp.over(
ws,
scope = lifecycleScope
)// subscribe topic
session.subscribe("topic", "1")session.events.onEach {
//TODO: handle event
}.launchIn(lifecycleScope)
```### iOS
```swift
let ws = WebSocketFactory_.shared.create(url: "ws://localhost:8081/connect/websocket")
//create session
let wrapper = SocketHelperKt.stomp(webSocket: ws)//subscribe topic
wrapper.subscribe(destination: "topic")wrapper.watch { event in
// handle event
}
```
# Release
### Groovy DSL
```groovy
implementation 'io.github.colagom:kowet:{version}'
```
### Kotlin DSL
```kotlin
implementation("io.github.colagom:kowet:{version}")
```