Open guanyilun opened 5 years ago
Thanks for tackling this. I'm pondering whether over-riding onJoin()
is the right way to go about this or if there is another way. At any rate, I think splitting off _register_procedures()
and _report_availability()
makes sense, so that's a good a move.
Another route might be to have get_fields() return a value indicating that it does not yet have the field list. This might be preferable than having a data node server running but not yet registered with the hub. But let me think some more about this.
This PR addresses the issue mentioned in #16. A quick summary of the problem is that dynamically generated fields only exist after data arrives, and before that any call to
get_fields
return no results. I think this is due to data node server prematurely declaring its availability to the hub when its fields are still unavailable. Here I changed it to only report availability to the hub after the data arrives and the fields have been populated, which I think makes more sense. This way we can be sure that any node added to the hub will work reliably.