Open gavin-norman-sociomantic opened 7 years ago
A note on the node information interfaces: it seems that they are unnecessary. For the swarm clients they totally make sense -- you have internal classes that do magic stuff which should absolutely not be exposed to the user, but you want to present the user an interface to the classes with purely non-destructive methods. In the case of the swarm nodes, however, there is no "user" to protect from scary internals.
It seems like these interfaces should just be removed; they serve no purpose and just make things more complicated.
A note on the node information interfaces: it seems that they are unnecessary.
Actually, they do serve a purpose: the actual node base classes are templated, so accessing the node via one of these information interfaces saves having to store templated references all over the place.
The node framework in swarm.core provides many useful components for building nodes. Currently, they are all glued together in a very rigid way. There is essentially one class (
ChannelsNodeBase
) which all nodes must derive from, in order to be able to access the full range of features. As the different types of nodes diverge in their needs, however, this approach is becoming less useful. A nicer approach would be to separate out each of the components so that they can be assembled as required.Components:
INodeInfo
andIChannelsNodeInfo
).It's interesting that the majority of the really interconnected stuff is for stats tracking / logging. Probably a better approach would be to have separate stats instances for different things (per-request, global I/O, etc), each with a
log()
method.