https://github.com/saantiaguilera/ds-protocol-gossip
Gossip protocol implementation in kotlin
https://github.com/saantiaguilera/ds-protocol-gossip
gossip gossip-protocol gossiping kotlin
Last synced: 7 months ago
JSON representation
Gossip protocol implementation in kotlin
- Host: GitHub
- URL: https://github.com/saantiaguilera/ds-protocol-gossip
- Owner: saantiaguilera
- Created: 2017-11-30T00:10:40.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-07T19:30:37.000Z (almost 8 years ago)
- Last Synced: 2025-01-27T13:10:31.798Z (9 months ago)
- Topics: gossip, gossip-protocol, gossiping, kotlin
- Language: Kotlin
- Homepage:
- Size: 61.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gossip
Gossip protocol implementation in Kotlin.
I do not recommend using this code in production environments, since its only for my own learning purpose (and trying out weird ideas)
If you wish to use it, feel free to distribute it / change it / whatever you please (I'll be glad this was useful for someone)
## Usage
Create the nodes
```kotlin
val members by lazy { ArrayList() }
settings.forEach { memberData ->
members.add(GossipMember(memberData.host, memberData.port, 0, memberData.clusterName))
}
```
Create a service for each of them
```kotlin
val services by lazy { ArrayList() }
members.forEach { services.add(GossipService(it)) }
```
Start services
```kotlin
services.forEach { it.start() }
```
Of course, you can inline most of these steps, I've simply split them so its understandable what im doing