블로그 이미지
Max.

calendar

    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Notice

'Non blocking'에 해당되는 글 1

  1. 2011.08.11 akka non blocking Test
2011.08.11 16:06 개발관련

1) Test Code

@Test
public void non_spring_non_blocking() throws InterruptedException{
CollectActor actor = TypedActor.newInstance(CollectActor.class,CollectActorImpl.class);
actor.setTimeAgentLogService(timeAgentLogService);
actor.setTimeAreaLogService(timeAreaLogService);
actor.setTimeLanguageLogService(timeLanguageLogService);
actor.setCollectorService(collectorService);
int count = 1;
do{
System.out.println(count + ") start...");
Thread.sleep(10);
RawLog codeLog = LawLogFixture.get();
CodeCreator codeCreator = CodeCreator.findCodeCreatorsByShortUrlEquals("B").getSingleResult();
codeLog.setCodeCreatorId(codeCreator.getId()); // id 전달
codeLog.setWriteDate(new Date());
actor.collectNonBlocking(codeLog);
count++;
}while(count < 6);
TypedActor.stop(actor);




         @Autowired private CollectActor collectActor;

@Test
public void spring_non_blocking() throws InterruptedException{
collectActor.setTimeAgentLogService(timeAgentLogService);
collectActor.setTimeAreaLogService(timeAreaLogService);
collectActor.setTimeLanguageLogService(timeLanguageLogService);
int count = 1;
do{
System.out.println(count + ") start...");
Thread.sleep(10);
RawLog codeLog = LawLogFixture.get();
CodeCreator codeCreator = CodeCreator.findCodeCreatorsByShortUrlEquals("B").getSingleResult();
codeLog.setCodeCreatorId(codeCreator.getId()); // id 전달
codeLog.setWriteDate(new Date());
collectActor.collectNonBlocking(codeLog);
count++;
}while(count < 6);
TypedActor.stop(collectActor);
}


2) 결과

1) start...
2) start...
[LOG] None Blocking start-----------------------------------------------------
3) start...
4) start...
5) start...
[log]AgentLog insert
[log]LanguageLog insert
[log]AreaLog insert
[LOG] None Blocking end-----------------------------------------------------
[LOG] None Blocking start-----------------------------------------------------
[log]AgentLog insert
[log]LanguageLog insert
[log]AreaLog insert
[LOG] None Blocking end-----------------------------------------------------
[LOG] None Blocking start-----------------------------------------------------
[log]AgentLog insert
[log]LanguageLog insert
[log]AreaLog insert
[LOG] None Blocking end-----------------------------------------------------
[LOG] None Blocking start-----------------------------------------------------
[log]AgentLog insert
[log]LanguageLog insert
[log]AreaLog insert
[LOG] None Blocking end-----------------------------------------------------
[LOG] None Blocking start-----------------------------------------------------
[log]AgentLog insert
[log]LanguageLog insert
[log]AreaLog insert
[LOG] None Blocking end----------------------------------------------------- 

저작자 표시
신고
posted by Max.
prev 1 next

티스토리 툴바