docs: add sell method rule

This commit is contained in:
realaltffour 2020-06-02 14:28:44 +03:00
parent ca398771c4
commit ec4fd6d1d8
No known key found for this signature in database
GPG Key ID: C1265D839D44DCB1
2 changed files with 46 additions and 1 deletions

Binary file not shown.

View File

@ -994,7 +994,7 @@ is an example of such exchange:
\subsubsection{Purchase}
The purchase sequence is done with the `purchaseAsset(sessionID, name,
quantity)' instruction. This communication is ver yclose the the previously
quantity)' instruction. This communication is very close the the previously
mentioned ones. The message is sent from a client to a worker. The worker
stores the message in it's cache and sends them to the master server in order
of time. The master server approves/disapproves the purchase and returns a code
@ -1037,4 +1037,49 @@ server. The following diagram is an example of such exchange:
\end{tikzpicture}
\end{center}
\subsubsection{Sell}
The sell sequence is done with the `sellAsset(sessionID, name, quantity)'
instruction. This communication is very close the the purchase mentioned
ones. The message is sent from a client to a worker. The worker stores the
message in it's cache and sends them to the master server in order of time. The
master server approves/disapproves the sell and returns a code (ref ...). The
return code is routed back to the client through the worker server. The
following diagram is an example of such exchange:
\begin{center}
\begin{tikzpicture}[>=stealth,every node/.style={shape=rectangle,draw
,rounded corners}]
% create the nodes
\node (masterserver) {Master Server};
\node (workerserver) [left=2cm of masterserver] {Worker Server};
\node (client) [left=2cm of workerserver] {Client};
\node (masterpurchase) [below=1cm of masterserver]
{purchaseAsset(username, ...)};
\node (workerpurchase) [below=1.7cm of workerserver]
{purchaseAsset(username, ...)};
\node (clientpurchase) [below=2.4cm of client]
{purchaseAsset(username, ...)};
\node(masterret) [below=1cm of masterlogin]
{purchaseSuccess()/purchaseFail()};
\node(workerret) [below=1.7cm of workerlogin]
{purchaseSuccess()/purchaseFail()};
\node(clientret) [below=2.4cm of clientlogin]
{purchaseSuccess()/purchaseFail()};
% link the nodes
\draw[->] (masterserver) -- (masterpurchase);
\draw[->] (workerserver) -- (workerpurchase);
\draw[->] (client) -- (clientpurchase);
\draw[->] (masterpurchase) -- (masterret);
\draw[->] (workerpurchase) -- (workerret);
\draw[->] (clientpurchase) -- (clientret);
\draw[->] (clientpurchase) -- (workerpurchase);
\draw[->] (workerpurchase) -- (masterpurchase);
\draw[<-] (clientret) -- (workerret);
\draw[<-] (workerret) -- (masterret);
\end{tikzpicture}
\end{center}
\end{document}