Project

General

Profile

Feature #2272

Strategy API: access to FaceTable

Added by Junxiao Shi almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Forwarding
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
2.00 h

Description

Allow strategies to access FaceTable, including:

  • enumerate Faces that satisfy a certain predicate
  • subscribe to onAdd and onRemove events

Related issues

Blocks NFD - Feature #1999: Strategy for access routerClosed

Blocked by ndn-cxx - Feature #2279: Signal: allow only owner to emit eventsClosed

History

#1 Updated by Junxiao Shi almost 5 years ago

#2 Updated by Junxiao Shi almost 5 years ago

  • Status changed from New to In Progress

#3 Updated by Junxiao Shi almost 5 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 100

#4 Updated by Alex Afanasyev almost 5 years ago

I don't understand why strategy needs to fire events for "create" and "remove" faces. I can understand that strategy may get notification about those events, but not invoke them. Strategy is not supposed to create faces and even if it creates, there should be separate non-strategy related interface for that.

#5 Updated by Junxiao Shi almost 5 years ago

  • Description updated (diff)

Strategies can subscribe to onAdd and onRemove events, which means they can get notifications.

The semantics of EventEmitter is that only the class in which EventEmitter is declared should trigger the event, and other classes can only subscribe to the event.
This rule is currently a convention; it cannot be enforced in code without changing declaration format.
This problem has nothing to do with #2272.

#6 Updated by Junxiao Shi almost 5 years ago

  • Blocked by Feature #2279: Signal: allow only owner to emit events added

#7 Updated by Junxiao Shi almost 5 years ago

  • Status changed from Code review to In Progress

Newly-introduced ndn::util::signal::Signal provides a way to prevent Strategy from raising FaceTable events.

Thus, I'm injecting a commit to convert FaceTable to use Signal: http://gerrit.named-data.net/1548

#8 Updated by Junxiao Shi almost 5 years ago

  • Status changed from In Progress to Closed

Also available in: Atom PDF