mirror of
https://gitee.com/BDWare/cm
synced 2025-01-10 01:44:04 +00:00
fix: fix bugs in event mechanism
fix bugs in event delivering cross nodes
This commit is contained in:
parent
5b4221dd29
commit
cf885a53fa
@ -1877,7 +1877,7 @@ public class ContractManager {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public String deliverEMessage(REvent msg) {
|
||||
public String deliverEvent(REvent msg) {
|
||||
eventBroker.handle(msg);
|
||||
return "success";
|
||||
}
|
||||
|
@ -96,6 +96,6 @@ public class ManagerHandler extends MsgHandler {
|
||||
@Description("Deliver event message")
|
||||
public void deliverEMessage(GetMessage msg, ResultCallback cb) {
|
||||
REvent eMsg = JsonUtil.fromJson(msg.arg, REvent.class);
|
||||
cb.onResult(cm.deliverEMessage(eMsg));
|
||||
cb.onResult(cm.deliverEvent(eMsg));
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ import org.bdware.sc.units.TrustfulExecutorConnection;
|
||||
|
||||
public interface CommitAlgorithm {
|
||||
void onMessage(Node node, byte[] msg);
|
||||
|
||||
void setCommitter(Committer c);
|
||||
|
||||
void setConnection(TrustfulExecutorConnection c);
|
||||
}
|
@ -5,12 +5,12 @@ import org.bdware.sc.conn.Node;
|
||||
import java.util.List;
|
||||
|
||||
public interface TrustfulExecutorConnection<T extends Node> {
|
||||
public void sendMessage(T node, byte[] msg);
|
||||
void sendMessage(T node, byte[] msg);
|
||||
|
||||
default public void broadcast(byte[] msg) {
|
||||
default void broadcast(byte[] msg) {
|
||||
for (T t : getNodes())
|
||||
sendMessage(t, msg);
|
||||
}
|
||||
|
||||
public List<T> getNodes();
|
||||
List<T> getNodes();
|
||||
}
|
Loading…
Reference in New Issue
Block a user