File tree Expand file tree Collapse file tree 3 files changed +36
-1
lines changed
Expand file tree Collapse file tree 3 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 0.36.4 - TBD
4+
5+ #### Enhancements
6+ - A disconnected ` Live ` client can now be reused with a different dataset
7+
38## 0.36.3 - 2024-07-02
49
510#### Enhancements
Original file line number Diff line number Diff line change @@ -605,6 +605,7 @@ def _cleanup_client(self) -> None:
605605 Cleanup any stateful client data.
606606 """
607607 self ._symbology_map .clear ()
608+ self ._dataset = ""
608609
609610 to_remove = []
610611 for stream in self ._user_streams :
Original file line number Diff line number Diff line change @@ -460,7 +460,7 @@ async def test_live_subscribe(
460460 mock_live_server : MockLiveServerInterface ,
461461 schema : Schema ,
462462 stype_in : SType ,
463- symbols : str ,
463+ symbols : str | None ,
464464 start : str ,
465465) -> None :
466466 """
@@ -635,6 +635,35 @@ def cb_sub(_: DBNRecord) -> None:
635635 assert second_sub .symbols == "TEST1"
636636
637637
638+ async def test_live_subscribe_different_dataset (
639+ live_client : client .Live ,
640+ mock_live_server : MockLiveServerInterface ,
641+ ) -> None :
642+ """
643+ Test that once a Live client is disconnected, it can be used with a
644+ different subscription dataset.
645+ """
646+ # Arrange
647+ live_client .subscribe (
648+ dataset = Dataset .GLBX_MDP3 ,
649+ schema = Schema .MBO ,
650+ )
651+
652+ # Act
653+ _ = await mock_live_server .wait_for_message_of_type (
654+ message_type = gateway .SubscriptionRequest ,
655+ )
656+
657+ live_client .start ()
658+ await live_client .wait_for_close ()
659+
660+ # Assert
661+ live_client .subscribe (
662+ dataset = Dataset .XNAS_ITCH ,
663+ schema = Schema .MBO ,
664+ )
665+
666+
638667@pytest .mark .usefixtures ("mock_live_server" )
639668def test_live_stop (
640669 live_client : client .Live ,
You can’t perform that action at this time.
0 commit comments