Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private async Task RunAsync(CancellationToken cancellationToken)
- {
- try
- {
- WorkerQueue q = new WorkerQueue();
- // TODO: Replace the following with your own logic.
- while (!cancellationToken.IsCancellationRequested)
- {
- String peekedMessage = q.peekMessage();
- if (peekedMessage != null)
- {
- Trace.TraceInformation(peekedMessage);
- char delimitor = '*';
- String[] substrings = peekedMessage.Split(delimitor);
- Calc calc = new Calc();
- String price = calc.calculate(substrings[0], substrings[1], substrings[2], substrings[3]);
- Trace.TraceInformation(substrings[0] + " " + substrings[1] + " " + substrings[2] + " " + substrings[3] + " " + price);
- q.sendMessage(substrings[0], substrings[1], substrings[2], substrings[3], price);
- }
- Trace.TraceInformation("Working");
- await Task.Delay(1000);
- }
- } catch (Exception e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement