This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AwaitableQueue<T> | |
{ | |
private readonly ConcurrentQueue<T> _queue = new ConcurrentQueue<T>(); | |
private long _count = 0; | |
private readonly ConcurrentQueue<TaskCompletionSource<T>> _pending = new ConcurrentQueue<TaskCompletionSource<T>>(); | |
/// <summary> | |
/// Enqueue the specified item. Blocking operation. | |
/// </summary> | |
/// <param name="item">Item.</param> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EventMessage | |
{ | |
public int What; | |
public int Arg0; | |
public int Arg1; | |
public object Obj1; | |
public Action<EventMessage> Handler; | |
} | |
/// <summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Queue<T> | |
{ | |
private readonly ConcurrentQueue<T> _queue = new ConcurrentQueue<T>(); | |
private long _count = 0; | |
private readonly Action<T> _action = null; | |
public Queue(Action<T> action) | |
{ | |
_action = action; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yaml | |
class Message(): | |
__start_mark = '{' | |
__end_mark = '}' | |
__item_tag = 'item' | |
__order_tag = 'order' | |
__hyperlink_types = [__order_tag, __item_tag] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace SomeRandomTest | |
{ | |
class Program |