   requireClient: (f) -> @notConnectedError() or f()
   requireNoClient: (f) -> @connectedError() or f()
 
-  msg: (type, data, f) ->
-    return unless @isConnected()
-    if f?
-      data.callback = @id = @id+1
-      @callbacks[@id] = f
-      @loading.working()
-    @output [type, data]
-
-  handle: (type, f) ->
-    @handlers[type] = f
-
   # TODO: this behaves weirdly because f is evaluated late
   # Should instead evalute f immediately and make sure messages are queued.
   withClient: (f) ->

      console.log "julia-client: unrecognised message #{type}"
      console.log data

  isConnected: -> false

  booting: ->


module.exports =

  # Messaging

  handlers: {}
  callbacks: {}
