Fork of socketio/socket.io-client-java 1.0.2, maintained at ParadiseDevTeam/socket.io-client-java.
- Added
IO.Options#eventExecutorto route every socket callback (open/message/close/error and allSocket#onlisteners) through a caller-suppliedExecutor, without having to callEventThread.setExecutoryourself. - Fixed
ExecutionTestto launch its subprocess viajavadirectly instead ofmvn exec:java. - Updated dependencies to their latest versions (
org.json,junit,hamcrest-library). - Migrated the build from Maven (
pom.xml) to Gradle (build.gradle.kts). - Publishes to repo.prdis.me (Reposilite) instead of Maven Central.
- Depends on ParadiseDevTeam/engine.io-client-java
1.0.2-patch.1, which introducesEventThread#setExecutor.
repositories {
maven { url = uri("https://repo.prdis.me/releases") }
}
dependencies {
implementation("io.socket:socket.io-client:1.0.2-patch.1")
}Useful for frameworks (e.g. Bukkit/Paper plugins) that require callbacks to run on a specific thread rather than the library's internal one:
IO.Options opts = new IO.Options();
opts.eventExecutor = runnable -> Bukkit.getScheduler().runTask(plugin, runnable);
Socket socket = IO.socket(uri, opts);This is equivalent to calling EventThread.setExecutor(myExecutor) yourself before connecting. It's a single, process-wide setting shared by every Socket instance in the JVM, not scoped to one Socket or Manager. Leave eventExecutor unset (null) to keep the default internal executor.
MIT (unchanged from upstream)