Skip to content

Commit

Permalink
new pushi support
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed May 22, 2018
1 parent 2b00441 commit 1077d05
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/digitalriver/models/provision.py
Expand Up @@ -224,15 +224,18 @@ def logger(message):

def create_pushi(self):

def on_connect(connection):
connection.subscribe_pushi(self.pid)
def on_connect(protocol):
protocol.subscribe_pushi(self.pid)

client_key = appier.conf("PUSHI_KEY")
client = pushi.PushiClient(client_key = client_key)
connection = client.connect_pushi(callback = on_connect)

_loop, protocol = pushi.net.PushiClient.connect_pushi_s(
client_key = client_key,
callback = on_connect
)

def logger(message):
connection.send_channel("stdout", message, self.pid, persist = False)
protocol.send_channel("stdout", message, self.pid, persist = False)

return logger

Expand Down

0 comments on commit 1077d05

Please sign in to comment.