Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 847 Bytes

README.md

File metadata and controls

37 lines (27 loc) · 847 Bytes

Stick

An event-based socket reconnection layer for Pharo smalltalk

Features

  • 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

Metacello new
  baseline: 'Stick';
  repository: 'github://mumez/Stick/repository';
  load.

Sample Code

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].