当前位置: 首页>>代码示例>>Java>>正文


Java PipeReader.getMsgIdx方法代码示例

本文整理汇总了Java中com.ociweb.pronghorn.pipe.PipeReader.getMsgIdx方法的典型用法代码示例。如果您正苦于以下问题:Java PipeReader.getMsgIdx方法的具体用法?Java PipeReader.getMsgIdx怎么用?Java PipeReader.getMsgIdx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ociweb.pronghorn.pipe.PipeReader的用法示例。


在下文中一共展示了PipeReader.getMsgIdx方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: consume

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consume(Pipe<MessagePubSub> input) {
    while (PipeReader.tryReadFragment(input)) {
        int msgIdx = PipeReader.getMsgIdx(input);
        switch(msgIdx) {
            case MSG_SUBSCRIBE_100:
                consumeSubscribe(input);
            break;
            case MSG_UNSUBSCRIBE_101:
                consumeUnsubscribe(input);
            break;
            case MSG_PUBLISH_103:
                consumePublish(input);
            break;
            case MSG_CHANGESTATE_70:
                consumeChangeState(input);
            break;
            case -1:
               //requestShutdown();
            break;
        }
        PipeReader.releaseReadLock(input);
    }
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:24,代码来源:MessagePubSub.java

示例2: consume

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consume(Pipe<TrafficOrderSchema> input) {
    while (PipeReader.tryReadFragment(input)) {
        int msgIdx = PipeReader.getMsgIdx(input);
        switch(msgIdx) {
            case MSG_GO_10:
                consumeGo(input);
            break;
            case MSG_BLOCKCHANNEL_22:
                consumeBlockChannel(input);
            break;
            case MSG_BLOCKCHANNELUNTIL_23:
                consumeBlockChannelUntil(input);
            break;
            case -1:
               //requestShutdown();
            break;
        }
        PipeReader.releaseReadLock(input);
    }
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:21,代码来源:TrafficOrderSchema.java

示例3: consume

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consume(Pipe<MessageSubscription> input) {
    while (PipeReader.tryReadFragment(input)) {
        int msgIdx = PipeReader.getMsgIdx(input);
        switch(msgIdx) {
            case MSG_PUBLISH_103:
                consumePublish(input);
            break;
            case MSG_STATECHANGED_71:
                consumeStateChanged(input);
            break;
            case -1:
               //requestShutdown();
            break;
        }
        PipeReader.releaseReadLock(input);
    }
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:18,代码来源:MessageSubscription.java

示例4: run

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
@Override
public void run() {
	while (PipeWriter.hasRoomForWrite(output) && PipeReader.tryReadFragment(input)) {
		int msgIdx = PipeReader.getMsgIdx(input);
		//System.out.format("\nMessage Idx %d %d %d\n", msgIdx, Pipe.tailPosition(input), input.sizeOfSlabRing);
		if (msgIdx >= 0) {
			MessageProcessor msg = messages[msgIdx];
			if (msg != null) {
				msg.readAndWrite(input, output);
			}
			//else {
				//System.out.format("Not Found %d", msgIdx);
			//}
			PipeReader.releaseReadLock(input);
		}
		else {
			PipeReader.releaseReadLock(input);
			PipeWriter.publishEOF(output);
			requestShutdown();
			//System.out.format("End of the line");
			return;
		}
	}
}
 
开发者ID:oci-pronghorn,项目名称:FogLight-Examples,代码行数:25,代码来源:FilterStage.java

示例5: run

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
@Override
public void run() {
	
	//TODO: (a short easy task) twitter wants a growing back-off here, we must record the last time we connected and DO NOT read until sufficient time has passed.
	
	while (PipeWriter.hasRoomForWrite(output) &&
			PipeReader.tryReadFragment(control)) {			
		int id = PipeReader.getMsgIdx(control);
		switch (id) {
			case -1:
				requestShutdown();
				return;				
			default:
				streamingRequest(output, id);
		}			
		PipeReader.releaseReadLock(control);			
	}
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:19,代码来源:RequestTwitterUserStreamStage.java

示例6: consume

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consume(Pipe<I2CBusSchema> input) {
    while (PipeReader.tryReadFragment(input)) {
        int msgIdx = PipeReader.getMsgIdx(input);
        switch(msgIdx) {
            case MSG_POINT_100:
                consumePoint(input);
            break;
            case MSG_STATE_200:
                consumeState(input);
            break;
            case -1:
               //requestShutdown();
            break;
        }
        PipeReader.releaseReadLock(input);
    }
}
 
开发者ID:oci-pronghorn,项目名称:FogLight,代码行数:18,代码来源:I2CBusSchema.java

示例7: consume

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consume(Pipe<MQTTClientRequestSchema> input) {
    while (PipeReader.tryReadFragment(input)) {
        int msgIdx = PipeReader.getMsgIdx(input);
        switch(msgIdx) {
            case MSG_BROKERCONFIG_100:
                consumeBrokerConfig(input);
            break;
            case MSG_CONNECT_1:
                consumeConnect(input);
            break;
            case MSG_PUBLISH_3:
                consumePublish(input);
            break;
            case MSG_SUBSCRIBE_8:
                consumeSubscribe(input);
            break;
            case MSG_UNSUBSCRIBE_10:
                consumeUnSubscribe(input);
            break;
            case -1:
               //requestShutdown();
            break;
        }
        PipeReader.releaseReadLock(input);
    }
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:27,代码来源:MQTTClientRequestSchema.java

示例8: consume

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consume(Pipe<PersistedBlobStoreSchema> input) {
    while (PipeReader.tryReadFragment(input)) {
        int msgIdx = PipeReader.getMsgIdx(input);
        switch(msgIdx) {
            case MSG_BLOCK_1:
                consumeBlock(input);
            break;
            case MSG_RELEASE_7:
                consumeRelease(input);
            break;
            case MSG_REQUESTREPLAY_6:
                consumeRequestReplay(input);
            break;
            case MSG_CLEAR_12:
                consumeClear(input);
            break;
            case -1:
               //requestShutdown();
            break;
        }
        PipeReader.releaseReadLock(input);
    }
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:24,代码来源:PersistedBlobStoreSchema.java

示例9: consume

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consume(Pipe<GroveRequestSchema> input) {
    while (PipeReader.tryReadFragment(input)) {
        int msgIdx = PipeReader.getMsgIdx(input);
        switch(msgIdx) {
            case MSG_DIGITALSET_110:
                consumeDigitalSet(input);
            break;
            case MSG_BLOCKCONNECTION_220:
                consumeBlockConnection(input);
            break;
            case MSG_BLOCKCONNECTIONUNTIL_221:
                consumeBlockConnectionUntil(input);
            break;
            case MSG_ANALOGSET_140:
                consumeAnalogSet(input);
            break;
            case -1:
               //requestShutdown();
            break;
        }
        PipeReader.releaseReadLock(input);
    }
}
 
开发者ID:oci-pronghorn,项目名称:FogLight,代码行数:24,代码来源:GroveRequestSchema.java

示例10: consume

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consume(Pipe<PersistedBlobLoadSchema> input) {
    while (PipeReader.tryReadFragment(input)) {
        int msgIdx = PipeReader.getMsgIdx(input);
        switch(msgIdx) {
            case MSG_BLOCK_1:
                consumeBlock(input);
            break;
            case MSG_BEGINREPLAY_8:
                consumeBeginReplay(input);
            break;
            case MSG_FINISHREPLAY_9:
                consumeFinishReplay(input);
            break;
            case MSG_ACKRELEASE_10:
                consumeAckRelease(input);
            break;
            case MSG_ACKWRITE_11:
                consumeAckWrite(input);
            break;
            case -1:
               //requestShutdown();
            break;
        }
        PipeReader.releaseReadLock(input);
    }
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:27,代码来源:PersistedBlobLoadSchema.java

示例11: consume

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consume(Pipe<I2CCommandSchema> input) {
    while (PipeReader.tryReadFragment(input)) {
        int msgIdx = PipeReader.getMsgIdx(input);
        switch(msgIdx) {
            case MSG_COMMAND_7:
                consumeCommand(input);
            break;
            case MSG_BLOCKCONNECTION_20:
                consumeBlockConnection(input);
            break;
            case MSG_BLOCKCONNECTIONUNTIL_21:
                consumeBlockConnectionUntil(input);
            break;
            case MSG_BLOCKCHANNEL_22:
                consumeBlockChannel(input);
            break;
            case MSG_BLOCKCHANNELUNTIL_23:
                consumeBlockChannelUntil(input);
            break;
            case -1:
               //requestShutdown();
            break;
        }
        PipeReader.releaseReadLock(input);
    }
}
 
开发者ID:oci-pronghorn,项目名称:FogLight,代码行数:27,代码来源:I2CCommandSchema.java

示例12: run

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
@Override
public void run() {
    
    while (PipeReader.tryReadFragment(input)) {
                    
        int msgIdx = PipeReader.getMsgIdx(input);
        switch(msgIdx) {
            case I2CBusSchema.MSG_POINT_100:
                outputPointDetails();
            break;
            case I2CBusSchema.MSG_STATE_200:
                outputStateDetails();
            break;   
            default:
                requestShutdown();
        }
        
        //pull common time and check that its always incrementing.
        //PipeReader.readLong(input, I2CBusSchema.MSG_STATE_200_FIELD_TIME_103)
                    
        PipeReader.releaseReadLock(input);
        
        
    }
}
 
开发者ID:oci-pronghorn,项目名称:FogLight,代码行数:26,代码来源:I2CSimulatedLineMonitorStage.java

示例13: consume

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consume(Pipe<BlockStorageReceiveSchema> input) {
    while (PipeReader.tryReadFragment(input)) {
        int msgIdx = PipeReader.getMsgIdx(input);
        switch(msgIdx) {
            case MSG_ERROR_3:
                consumeError(input);
            break;
            case MSG_WRITEACK_2:
                consumeWriteAck(input);
            break;
            case MSG_DATARESPONSE_1:
                consumeDataResponse(input);
            break;
            case -1:
               //requestShutdown();
            break;
        }
        PipeReader.releaseReadLock(input);
    }
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:21,代码来源:BlockStorageReceiveSchema.java

示例14: consume

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consume(Pipe<IngressMessages> input) {
    while (PipeReader.tryReadFragment(input)) {
        int msgIdx = PipeReader.getMsgIdx(input);
        switch(msgIdx) {
            case MSG_PUBLISH_103:
                consumePublish(input);
            break;
            case -1:
               //requestShutdown();
            break;
        }
        PipeReader.releaseReadLock(input);
    }
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:15,代码来源:IngressMessages.java

示例15: consume

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consume(Pipe<TrafficAckSchema> input) {
    while (PipeReader.tryReadFragment(input)) {
        int msgIdx = PipeReader.getMsgIdx(input);
        switch(msgIdx) {
            case MSG_DONE_10:
                consumeDone(input);
            break;
            case -1:
               //requestShutdown();
            break;
        }
        PipeReader.releaseReadLock(input);
    }
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:15,代码来源:TrafficAckSchema.java


注:本文中的com.ociweb.pronghorn.pipe.PipeReader.getMsgIdx方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。