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

Not working AmiClient.Subscribe #20

Open
GolDiV opened this issue Jun 28, 2023 · 0 comments
Open

Not working AmiClient.Subscribe #20

GolDiV opened this issue Jun 28, 2023 · 0 comments

Comments

@GolDiV
Copy link

GolDiV commented Jun 28, 2023

I dont understand why method Subscribe not working. Example:
This code

var response = await amiClient.Where(message => message["Event"] == "Newstate").FirstAsync();
foreach (var item in response)
                {
                    Console.WriteLine(item.Key + ":" + item.Value);
                }

work good, but this:

var subscription = ami.Where(message => message["Event"] == "Newstate")
        .Subscribe(response =>
        {
            if (response != null)
            {
                foreach (var item in response)
                {
                    Console.WriteLine(item.Key + ":" + item.Value);
                }
            }
        });

not work.
I wait that this code wait all events "Newstate" and write to console. What am I doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant