You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//set stream countvarintStreams=4;//current streamvarintCurrentStream=1;varfnOnMessage=function(objMsg){//assuming this function will send to the stream specifiedfnSendMessage(intCurrentStream,objMsg);//update the stream pointerif(intCurrentStream===intStreams){//resetintCurrentStream=1;}else{//incrementintCurrentStream++;}}
Stream sort / map example
varobjMap={"production":1,"development":2,"staging":3,"certification":4};varfnOnMessage(objMsg){//assuming this function will send to the stream specified//map the environment data by the mapfnSendMessage(objMap[objMsg.environment],objMsg);}
Sort by schema example
//properties to look for in an objectvarobjMap={"ip":1,"url":2,"sha256":3,"regex":4};vararrFields=Object.keys(objMap);varfnOnMessage(objMsg){varfFound=false;varintStream=0;for(vari=0;i<arrFields.length;i++){if(fFound===false&&typeofobjMsg[arrFields[i]]!=='undefined'){intStream=objMap[arrFields[i]];//stop on first one foundfFound=true;}}//assuming this function will send to the stream specifiedfnSendMessage(intStream,objMsg);}