mathpaquette / IQFeed.CSharpApiClient

IQFeed.CSharpApiClient is fastest and the most well-designed C# DTN IQFeed socket API connector available
MIT License
120 stars 43 forks source link

Level1 snapshot methods will stop current watches on same symbols #44

Closed mrut2pac closed 4 years ago

mrut2pac commented 4 years ago

Not sure if that is the expected behavior, but if you call any of these snapshot methods:

on a client while there was an ongoing ReqWatch on the same symbol, the updates will stop since both of them are calling ReqUnwatch on completion.

From the user perspective I didn't expect that. I though I'd report it here, FYI.

mathpaquette commented 4 years ago

@mrut2pac thanks for contacting us ! Yes, I agree with you from the client perspective, this is not something expected. We should have a shared count and only unsubscribe if the count equals 1. What do you think?

mrut2pac commented 4 years ago

Yeah, makes sense.

mathpaquette commented 4 years ago

@mrut2pac what do you of instead of writing additional logic to handle that, Im suggesting to users to use a new Level1 client which cannot unsubscribe already streaming symbols.

mrut2pac commented 4 years ago

In my code I have another layer that maintains subscriptions. When Fundamental or Quote snapshots are requested I return it if the subscription already exists otherwise I create a new one that gets expired after a configured timeout. Your suggestion sounds like a good workaround, but not a nice long term solution. Let's think about it a bit more. I will post if I have any ideas.