+ remote_move_keys(node, node->fingers[0].id); // take some key-value pairs from my successor
+}
+
+/**
+ * \brief Makes the current node quit the system
+ * \param node the current node
+ */
+static void leave(node_t node)
+{
+ INFO0("Well Guys! I Think it's time for me to quit ;)");
+ quit_notify(node,1); // notify to my successor ( >>> 1 );
+ quit_notify(node,-1); // notify my predecessor ( >>> -1);
+ // TODO ...
+}
+/*
+ * \brief Notify msg to tell my successor||predecessor about my departure
+ * \param node the current node
+ */
+static void quit_notify(node_t node, int to)
+{
+ task_data_t req_data = xbt_new0(s_task_data_t, 1);
+ req_data->request_id = node->id;
+ req_data->successor_id = node->fingers[0].id;
+ req_data->pred_id = node->pred_id;
+ req_data->issuer_host_name = MSG_host_get_name(MSG_host_self());
+ const char *task_name = NULL;
+ const char* to_mailbox;
+ if( to == 1) // notify my successor
+ {
+ to_mailbox = node->fingers[0].mailbox;
+ INFO1("Telling my Successor about my departure via mailbox %s", to_mailbox);
+ task_name = "Predecessor Leaving";
+
+ }
+ else if(to == -1) // notify my predecessor
+ {
+ to_mailbox = node->pred_mailbox;
+ INFO1("Telling my Predecessor about my departure via mailbox %s",to_mailbox);
+ task_name = "Predecessor Leaving";
+ }
+ m_task_t task = MSG_task_create(task_name, 1000, 5000, req_data);
+ //char* mailbox = get_mailbox(to_mailbox);
+ msg_comm_t comm = MSG_task_isend(task, to_mailbox);