I'm trying:
request = WebRequest.Create( uri )
responseTask = request.GetResponseAsync
action = Action.new { process_request( sender, e ) }
task = Task.new( action )
responseTask.Wait( TimeSpan.new( -1 ) )
responseTask.ContinueWith( task )
But have following error:
can't convert System::Threading::Tasks::Task into System::Action[System::Threading::Tasks::Task] (TypeError)
UPD
On
responseTask = request.GetResponseAsync
action = Action[Task].new { process_request( sender, e ) }
responseTask.Wait( TimeSpan.new( -1 ) )
responseTask.ContinueWith( action )
I'm getting this error:
Found multiple methods for 'ContinueWith': ContinueWith(System::Action[System::Threading::Tasks::Task]), ContinueWith(System::Action[System::Threading::Tasks::Task[System::Net::WebResponse]]) (System::Reflection::AmbiguousMatchException)