Skip to content
/ Stick Public

An event-based socket reconnection layer for Pharo smalltalk

License

Notifications You must be signed in to change notification settings

mumez/Stick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

An event-based socket reconnection layer for Pharo smalltalk

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published