Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mumez/stick
An event-based socket reconnection layer for Pharo smalltalk
https://github.com/mumez/stick
gemstone pharo pharo-smalltalk reconnect socket-io
Last synced: 3 months ago
JSON representation
An event-based socket reconnection layer for Pharo smalltalk
- Host: GitHub
- URL: https://github.com/mumez/stick
- Owner: mumez
- License: mit
- Created: 2019-01-10T13:40:47.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-06-13T03:48:22.000Z (over 1 year ago)
- Last Synced: 2024-09-25T21:41:09.418Z (4 months ago)
- Topics: gemstone, pharo, pharo-smalltalk, reconnect, socket-io
- Language: Smalltalk
- Homepage:
- Size: 61.5 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Stick
An event-based socket reconnection layer for [Pharo](https://pharo.org) smalltalk## Features
- [Socket.IO](https://socket.io/) like event-based API
- Supports auto reconnection to a server
- Supports auto switching to alternative servers
- Provides base classes for implementing sync/async socket client## Installation
```smalltalk
Metacello new
baseline: 'Stick';
repository: 'github://mumez/Stick/repository';
load.
```## Sample Code
```smalltalk
stick := SkStick targetUrl: 'async://google.com:80'.
stick logger logLevel: 5.
stick onConnected: [ stick logger info: 'connected' ].
stick onError: [:ex | ex isReconnectEnded ifTrue: [stick stick]].
stick onReceive: [ :stream | | size data |
data := stream next: 10.
Transcript cr; show: data asString.
].
stick connect.stick send: #[0 1 2 3 4 5 6 7 8 9].
```