/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * license agreements; and to You under the Apache License, version 2.0:
 *
 *   https://www.apache.org/licenses/LICENSE-2.0
 *
 * This file is part of the Apache Pekko project, which was derived from Akka.
 */

/*
 * Copyright (C) 2009-2022 Lightbend Inc. <https://www.lightbend.com>
 */

syntax = "proto2";

option java_package = "org.apache.pekko.remote";
option optimize_for = SPEED;

import "ContainerFormats.proto";

/******************************************
 * System message formats
 ******************************************/

message SystemMessage {
    enum Type {
        CREATE = 0;
        RECREATE = 1;
        SUSPEND = 2;
        RESUME = 3;
        TERMINATE = 4;
        SUPERVISE = 5;
        WATCH = 6;
        UNWATCH = 7;
        FAILED = 8;
        DEATHWATCH_NOTIFICATION = 9;
    }

    required Type type = 1;

    optional WatchData watchData = 2;
    optional Payload causeData = 3;
    optional SuperviseData superviseData = 5;
    optional FailedData failedData = 6;
    optional DeathWatchNotificationData dwNotificationData = 7;

}

message WatchData {
    required ActorRef watchee = 1;
    required ActorRef watcher = 2;
}

message SuperviseData {
    required ActorRef child = 1;
    required bool async = 2;
}

message FailedData {
    required ActorRef child = 1;
    required uint64 uid = 2;
}

message DeathWatchNotificationData {
    required ActorRef actor = 1;
    required bool existenceConfirmed = 2;
    required bool addressTerminated = 3;
}





