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

No notifications for appearing/disappearing subnodes? #16

Open
prizmod opened this issue Apr 27, 2020 · 1 comment
Open

No notifications for appearing/disappearing subnodes? #16

prizmod opened this issue Apr 27, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@prizmod
Copy link

prizmod commented Apr 27, 2020

Hello there.

First of all, I really appreciate the amount of work you've put into overhauling this library!

I have previously been using the evs-broadcast fork of this lib in a project of mine and your version has addressed many of the issues I had experienced.

However, I am facing the following issue:

What's the problem?

Suppose there is a Node X which is already known to the consumer. The consumer queries the children of X by sending a getDirectory request to the provider. The provider tells the consumer that X has one child: The Node Y.

Now suppose that after some time, the provider creates an additional Node Z as a child of X. Since the consumer previously performed a getDirectory on X, the new child Z will be reported by the provider.

The EmberClient actually handles this correctly and adds Z as a child to X. However, there seems to be no (obvious) way to receive any sort of notification about this in the node-emberplus library!

The same applies to a scenario where Node Y is removed (isOnline=false).

I would have expected to be notified through the callback I can provide when calling EmberClient.getDirectory, but that only works for Parameter/Matrix nodes.

Why is it relevant?

I have a usecase where I need to "listen" for the creation and deletion of subnodes (actually subtrees in my case) below a certain Node. Everytime a subnode appears, I instantiate an object which serves as a functional representation of the structures below this subnode. Once the subnode disappears, I need to discard this instance.

How can it be reproduced?

  1. Connect to an Ember+ provider.
  2. Query the children of a node by sending a getDirectory request.
  3. Perform an action on the provider that causes children to appear (or disappear).
  4. Go sit in a corner and cry because the Node doesn't tell you anything about this! /s
@dufourgilles
Copy link
Owner

Hi,
Glad you like this version.
I can add this option to call the callback on node changed as well.
Quite busy at the moment, so can't tell you when this will be ready.
But I'll let you know when available.

Gilles.

@dufourgilles dufourgilles self-assigned this May 2, 2020
@dufourgilles dufourgilles added the enhancement New feature or request label May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants