MCPcopy Create free account
hub / github.com/e2wugui/zeze / CsQueue

Method CsQueue

ZezeJava/ZezeJava/src/main/java/Zeze/Collections/CsQueue.java:25–43  ·  view source on GitHub ↗

为了测试公开这个方法,应用应该去使用Queue.Module.open.

(Queue.Module module, String name, int serverId, Class<V> valueClass, int nodeSize)

Source from the content-addressed store, hash-verified

23 * 为了测试公开这个方法,应用应该去使用Queue.Module.open.
24 */
25 public CsQueue(Queue.Module module, String name, int serverId, Class<V> valueClass, int nodeSize) {
26 this.module = module;
27 this.name = name;
28 this.queue = module._open(name + "@" + serverId, valueClass, nodeSize);
29
30 var out = new OutLong();
31 Task.call(module.zeze.newProcedure(() -> {
32 var root = queue.getOrAddRoot();
33 root.setLastNodeId(root.getLoadSerialNo() + 1);
34 out.value = root.getLoadSerialNo();
35 return 0;
36 }, "increaseLoadSerialNo"));
37 var offlineNotify = new BOfflineNotify();
38 offlineNotify.serverId = module.zeze.getConfig().getServerId();
39 offlineNotify.notifySerialId = out.value;
40 offlineNotify.notifyId = "Zeze.Collections.CsQueue.OfflineNotify";
41 module.zeze.getServiceManager().offlineRegister(offlineNotify,
42 (notify) -> splice(notify.serverId, notify.notifySerialId));
43 }
44
45 public long getLoadSerialNo() {
46 var out = new OutLong();

Callers

nothing calls this directly

Calls 11

callMethod · 0.95
spliceMethod · 0.95
getOrAddRootMethod · 0.80
getLoadSerialNoMethod · 0.65
getServerIdMethod · 0.65
_openMethod · 0.45
newProcedureMethod · 0.45
setLastNodeIdMethod · 0.45
getConfigMethod · 0.45
offlineRegisterMethod · 0.45
getServiceManagerMethod · 0.45

Tested by

no test coverage detected