Skip to content

Commit

Permalink
Upgrade to ServiceHandlerNew
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperl committed Apr 28, 2023
1 parent 51fbb3a commit c734464
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/service.toit
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import mqtt.packets as mqtt
import .internal.api show QubitroService

import system.assets
import system.services show ServiceHandler ServiceProvider ServiceResource
import system.services show ServiceHandlerNew ServiceProvider ServiceResource
import system.base.network show NetworkModule NetworkState NetworkResource

HOST ::= "broker.qubitro.com"
Expand All @@ -35,16 +35,16 @@ main:
service.install
logger.info "service running"

class QubitroServiceProvider extends ServiceProvider implements ServiceHandler:
class QubitroServiceProvider extends ServiceProvider implements ServiceHandlerNew:
logger_/log.Logger
defines_/Map
state_ ::= NetworkState

constructor .logger_ .defines_:
super "qubitro" --major=1 --minor=0
provides QubitroService.SELECTOR --handler=this
provides QubitroService.SELECTOR --handler=this --new

handle pid/int client/int index/int arguments/any -> any:
handle index/int arguments/any --gid/int --client/int -> any:
if index == QubitroService.CONNECT_INDEX:
return connect arguments client
if index == QubitroService.PUBLISH_INDEX:
Expand Down

0 comments on commit c734464

Please sign in to comment.