public class EventRunner extends Object
Constructor and Description |
---|
EventRunner(EventRunnerGroup eventRunnerGroup)
事件处理 Thread
|
Modifier and Type | Method and Description |
---|---|
void |
addEvent(int priority,
Runnable runnable)
添加事件
|
Object |
attachment()
获取附属对象
|
void |
attachment(Object attachment)
设置附属对象
|
PriorityBlockingQueue<EventTask> |
getEventQueue()
获取事件任务对象集合
|
Thread |
getThread()
获取绑定的线程
|
void |
process()
执行, 在 EventRunnerGroup 执行
|
public EventRunner(EventRunnerGroup eventRunnerGroup)
eventRunnerGroup
- EventRunnerGroup对象public Thread getThread()
public Object attachment()
public void attachment(Object attachment)
attachment
- 附属对象public void addEvent(int priority, Runnable runnable)
priority
- 事件优先级必须在1-10之间runnable
- 事件执行器public PriorityBlockingQueue<EventTask> getEventQueue()
public void process()
Copyright © 2020 Voovan. All rights reserved.