public void Cancel_with_ruly_canceller()
        {
            var canceler = new RulyCanceler();
            new Thread(()=>
            {
                try
                {
                    Work(canceler);
                }catch(OperationCanceledException){Console.WriteLine("Canceled!");}
            }).Start();

            canceler.Cancel();
        }
        private void Work(RulyCanceler canceler)
        {
            while (true)
            {
                canceler.ThrowIfCancellationRequested();

                try
                {
                    OtherMethod(canceler);
                }
                finally
                {
                    //cleanup resources
                }

            }
        }
 private void OtherMethod(RulyCanceler canceler)
 {
     canceler.ThrowIfCancellationRequested();
 }