Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.5.0 #56

Merged
merged 2 commits into from
Aug 2, 2024
Merged

v1.5.0 #56

merged 2 commits into from
Aug 2, 2024

Conversation

DobromirM
Copy link
Member

Changes:

  1. Downlinks will now reconnect by default when there is a connection failure.
  2. Added keep_linked and keep_synced
...

value_downlink = swim_client.downlink_value()
value_downlink.set_host_uri('ws://localhost:9001/')
value_downlink.set_node_uri('/unit/foo')
value_downlink.set_lane_uri('info')

value_downlink.keep_synced(True)
value_downlink.keep_linked(False)

...
  1. Added method for waiting until all client tasks are completed. The behaviour is modeled after the [Thread.join interface](https://docs.python.org/3/library/threading.html#threading.Thread.join).
    Fred, This should address the problem that you had.
if __name__ == '__main__':
    swim_client = SwimClient()
    swim_client.start()

    event_downlink = swim_client.downlink_event()
    event_downlink.set_host_uri('ws://localhost:9001/')
    event_downlink.set_node_uri('/unit/foo')
    event_downlink.set_lane_uri("publishValue")
    event_downlink.on_event(custom_on_event)
    event_downlink.open()

    # This is used to block the thread until all client tasks have completed
    swim_client.join()

    # Alternatively, a maximum timeout may be provided which will unblock the thread after it has elapsed
    # swim_client.join(timeout=300)
  1. Added custom errors for trying to open a downlink before first setting the host, node or lane. Closes Error messages for invalid downlinks #53

* Added `keepLinked` and `keepSynced`.
* Added error messages for missing host, node and lane uri when opening downlinks.
* Added method for waiting until the client is closed manually.
* Fixed unit tests.
* Added default retry strategy.
@DobromirM DobromirM self-assigned this Aug 2, 2024
@DobromirM DobromirM added the enhancement Implement agreed feature label Aug 2, 2024
@DobromirM DobromirM merged commit 3e5ac58 into main Aug 2, 2024
2 checks passed
@DobromirM DobromirM deleted the v1.5.0 branch August 2, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Implement agreed feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error messages for invalid downlinks
1 participant