Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

Commit

Permalink
hopefully build using jdk8
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Jan 8, 2017
1 parent b96e878 commit 9fca665
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ abstract class ClientConduit(open val rh: CoreReceiver.() -> Unit) {
abstract fun executeWithCallback(clientId: String, js: String, callbackId: Int, handler: (String) -> Unit)
}

class ReadableElement(val tag: String, val attributes: Map<String, Object>)
class ReadableElement(val tag: String, val attributes: Map<String, Any>)

class Document(private val receiver: CoreReceiver) {
fun getElementById(id: String) = Element(receiver, "document.getElementById(\"$id\")")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import java.util.concurrent.ConcurrentHashMap

typealias OneTime = Boolean

class WebsocketsClientConduit(val port: Int, val startHead: String = "", val endHead: String = "", override open val rh: CoreReceiver.() -> Unit) : ClientConduit(rh) {
class WebsocketsClientConduit(val port: Int, val startHead: String = "", val endHead: String = "", override val rh: CoreReceiver.() -> Unit) : ClientConduit(rh) {
private val server = AppServer(AppConfiguration(port = port))
private val clients: MutableMap<String, WSClientData>

Expand Down Expand Up @@ -61,10 +61,10 @@ class WebsocketsClientConduit(val port: Int, val startHead: String = "", val end
}


override fun execute(clientId: String, js: String) {
override fun execute(clientId: String, message: String) {
//println("execute($js)")
val wsClientData = clients.get(clientId) ?: throw RuntimeException("Client id $clientId not found")
wsClientData.send(S2CWebsocketMessage(yourId = clientId, execute = Execute(js)))
wsClientData.send(S2CWebsocketMessage(yourId = clientId, execute = Execute(message)))
}

override fun executeWithCallback(clientId: String, js: String, callbackId: Int, handler: (String) -> Unit) {
Expand Down

0 comments on commit 9fca665

Please sign in to comment.