def sendCreatedOrUpdatedUpdates(self, modelSetKey: str, traceConfigKeys: List[str]) -> None: """ Send Create or Updated Updates Send grid updates to the client services :param modelSetKey: The model set key :param traceConfigKeys: A list of the keys updated :returns: Nothing """ if not traceConfigKeys: return if peekClientName not in VortexFactory.getRemoteVortexName(): logger.debug( "No clients are online to send the trace configs to, %s", traceConfigKeys) return def send(vortexMsg: bytes): if vortexMsg: VortexFactory.sendVortexMsg(vortexMsg, destVortexName=peekClientName) d: Deferred = self._loadTraceConfigs(modelSetKey, traceConfigKeys) d.addCallback(send) d.addErrback(self._sendErrback, traceConfigKeys)
def sendDeleted(self, modelSetKey: str, traceConfigKeys: List[str]) -> None: """ Send Deleted Send grid updates to the client services :param modelSetKey: The model set key :param traceConfigKeys: A list of object buckets that have been updated :returns: Nothing """ if not traceConfigKeys: return if peekClientName not in VortexFactory.getRemoteVortexName(): logger.debug("No clients are online to send the doc chunk to, %s", traceConfigKeys) return payload = Payload(filt=copy(clientTraceConfigUpdateFromServerFilt)) payload.filt[plDeleteKey] = True payload.tuples = dict(modelSetKey=modelSetKey, traceConfigKeys=traceConfigKeys) payloadEnvelope = yield payload.makePayloadEnvelopeDefer() vortexMsg = yield payloadEnvelope.toVortexMsgDefer() try: VortexFactory.sendVortexMsg(vortexMsg, destVortexName=peekClientName) except Exception as e: logger.exception(e)