diff --git a/event.go b/event.go index 64440b2..9322b8a 100644 --- a/event.go +++ b/event.go @@ -10,7 +10,7 @@ import ( ) // Update the events listeners, and notify the parent to do the same -func (event * BaseEvent) update(signal GraphSignal) { +func (event * BaseEvent) PropagateUpdate(signal GraphSignal) { if signal.Downwards() == false { // Child->Parent event.parent_lock.Lock() diff --git a/gql.go b/gql.go index a47800b..b9ca2c8 100644 --- a/gql.go +++ b/gql.go @@ -873,9 +873,9 @@ func NewGQLServer(listen string, extended_types map[reflect.Type]*graphql.Object return server } -func (server * GQLServer) update(signal GraphSignal) { +func (server * GQLServer) PropagateUpdate(signal GraphSignal) { server.signal <- signal - server.BaseResource.update(signal) + server.BaseResource.PropagateUpdate(signal) } func GQLSubscribeSignal(p graphql.ResolveParams) (interface{}, error) { diff --git a/graph.go b/graph.go index 4391c67..167288f 100644 --- a/graph.go +++ b/graph.go @@ -154,7 +154,7 @@ type GraphNode interface { Description() string ID() string UpdateListeners(update GraphSignal) - update(update GraphSignal) + PropagateUpdate(update GraphSignal) RegisterChannel(listener chan GraphSignal) UnregisterChannel(listener chan GraphSignal) UpdateChannel() chan GraphSignal @@ -255,7 +255,7 @@ func (node * BaseNode) UpdateListeners(update GraphSignal) { node.listeners_lock.Unlock() } -func (node * BaseNode) update(signal GraphSignal) { +func (node * BaseNode) PropagateUpdate(signal GraphSignal) { } func SendUpdate(node GraphNode, signal GraphSignal) { @@ -265,6 +265,6 @@ func SendUpdate(node GraphNode, signal GraphSignal) { } log.Logf("update", "UPDATE %s <- %s: %+v", node_name, signal.Source(), signal) node.UpdateListeners(signal) - node.update(signal) + node.PropagateUpdate(signal) } diff --git a/resource.go b/resource.go index f1260ce..ee24798 100644 --- a/resource.go +++ b/resource.go @@ -8,7 +8,7 @@ import ( // Resources propagate update up to multiple parents, and not downwards // (subscriber to team won't get update to alliance, but subscriber to alliance will get update to team) -func (resource * BaseResource) update(signal GraphSignal) { +func (resource * BaseResource) PropagateUpdate(signal GraphSignal) { if signal.Downwards() == false { // Child->Parent, resource updates parent resources