public bool RemoveBinding(Destination dest, out FlowBindingElement bind) { string key = MakeDestinationKey(dest); bind = null; bool removed = false; lock (bindings) { if (bindings.TryGetValue(key, out bind)) { bindings.Remove(key); removed = true; } } return(removed); }
public bool AddBinding(Destination dest, BufferBlock <Message> messageQueue, BufferBlock <FlowStateContext> flowEvtQueue, out FlowBindingElement bind) { string key = MakeDestinationKey(dest); bool created = false; lock (bindings) { if (!bindings.ContainsKey(key)) { bindings.Add(key, new FlowBindingElement(dest, messageQueue, flowEvtQueue, logger)); created = true; } bind = bindings[key]; } return(created); }