https://github.com/mtamme/signalr-client
An extensible asynchronous SignalR client for Java.
https://github.com/mtamme/signalr-client
asynchronous java signalr-client
Last synced: 4 months ago
JSON representation
An extensible asynchronous SignalR client for Java.
- Host: GitHub
- URL: https://github.com/mtamme/signalr-client
- Owner: mtamme
- License: apache-2.0
- Created: 2014-02-08T11:17:49.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-10-23T08:51:08.000Z (over 8 years ago)
- Last Synced: 2025-03-31T05:24:45.913Z (over 1 year ago)
- Topics: asynchronous, java, signalr-client
- Language: Java
- Homepage:
- Size: 738 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# signalr-client
An extensible asynchronous SignalR client for Java.
**This is currently a prototype and therefore not applicable for production use!**
## Persistent Connections API
```java
final PersistentConnection connection = new PersistentConnection(
"http://localhost/signalr",
new WebSocketTransport(),
new JacksonFactory());
connection.addConnectionListener(new ConnectionAdapter() {
@Override
public void onReceived(final String message) {
System.out.println(message);
}
});
final Promise promise = connection.start();
Promises.await(promise);
final Scanner scanner = new Scanner(System.in);
while (scanner.hasNextLine()) {
final String line = scanner.nextLine();
connection.send(line);
}
```
## Hubs API
```java
final HubConnection connection = new HubConnection(
"http://localhost/signalr",
new WebSocketTransport(),
new GsonFactory());
final HubProxy proxy = connection.newHubProxy("hub");
proxy.register("update", Update.class, new HubCallback() {
@Override
public void onInvoke(final Update update) {
System.out.println(update);
}
});
final Promise promise = connection.start().then(new Compose() {
@Override
protected Promise doCompose(final Void value) throws Exception {
return proxy.invoke("joinUpdateGroup", Void.class);
}
});
Promises.await(promise);
```
## Extensibility
# Copyright
Copyright © Martin Tamme. See LICENSE for details.