You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scenario:
The boker is unavailable at startup.
The connection is retrying in the background.
Calls to:
Tortoise.publish("my_client_id", "foo/bar", "Hello from the World of Tomorrow !", qos: 1)
-- or --
Tortoise.publish_sync("my_client_id", "foo/bar", "Hello from the World of Tomorrow !", qos: 1)
block forever.
This is due to the default timeout of :infinity at line 329 in Tortoise.connection.
I realise that I can put logic in place as the application has not been notified of a connection state change to not allow publishing. This was my first naive attempt at using Tortoise.
Passing a timeout value causes via either of the calls causes the following match errors:
** (WithClauseError) no with clause matching: {:error, :timeout}
(tortoise 0.9.8) lib/tortoise.ex:269: Tortoise.publish/4
** (WithClauseError) no with clause matching: {:error, :timeout}
(tortoise 0.9.8) lib/tortoise.ex:329: Tortoise.publish_sync/4
Should the {:error, :timeout} be handled in Tortoise.publish or should the timeout be translated to {:error, :unknown_connection}?
The documentation is also incorrect in this respect.
Happy to help with pull request or is it a case of wait for mqtt-5 branch?
The text was updated successfully, but these errors were encountered:
Tortoise: 0.9.8
Elixir 1.11.3-otp-22
Erlang 23.2.6
Scenario:
The boker is unavailable at startup.
The connection is retrying in the background.
Calls to:
Tortoise.publish("my_client_id", "foo/bar", "Hello from the World of Tomorrow !", qos: 1)
-- or --
Tortoise.publish_sync("my_client_id", "foo/bar", "Hello from the World of Tomorrow !", qos: 1)
block forever.
This is due to the default timeout of :infinity at line 329 in Tortoise.connection.
I realise that I can put logic in place as the application has not been notified of a connection state change to not allow publishing. This was my first naive attempt at using Tortoise.
Passing a timeout value causes via either of the calls causes the following match errors:
** (WithClauseError) no with clause matching: {:error, :timeout}
(tortoise 0.9.8) lib/tortoise.ex:269: Tortoise.publish/4
** (WithClauseError) no with clause matching: {:error, :timeout}
(tortoise 0.9.8) lib/tortoise.ex:329: Tortoise.publish_sync/4
Should the {:error, :timeout} be handled in Tortoise.publish or should the timeout be translated to {:error, :unknown_connection}?
The documentation is also incorrect in this respect.
Happy to help with pull request or is it a case of wait for mqtt-5 branch?
The text was updated successfully, but these errors were encountered: