Closed benoittgt closed 6 years ago
The README contains an example on how to do async calls:
# prepare push
push = connection.prepare_push(notification)
push.on(:response) do |response|
# read the response
response.ok? # => true
response.status # => '200'
response.headers # => {":status"=>"200", "apns-id"=>"6f2cd350-bfad-4af0-a8bc-0d501e9e1799"}
response.body # => ""
end
# send
connection.push_async(push)
Why are you calling push_async
inside of a callback?
Thanks.
Closing for now because our implementation doesn't follow the recommended way.
Hello,
This probably a known issue/behavior https://github.com/ostinelli/apnotic/issues/14 but I have this kind of code:
But the worker (
XWorker
) "lock" the action and we loop forever in https://github.com/ostinelli/net-http2/blob/master/lib/net-http2/client.rb#L59.So instead I have to run the code immediately and avoid using the worker. Is it normal? I tried to understand without finding the solution.