16 Commits

Author SHA1 Message Date
amaitland 25ab209380 MethodRunnerQueue/ConcurrentMethodRunnerQueue - Remove custom task execution queue
- ConcurrentMethodRunnerQueue we now directly queue tasks on TaskScheduler.Default
- MethodRunnerQueue now uses LimitedConcurrencyLevelTaskScheduler (example from Microsoft) to limit execution to one concurrent task
- MethodRunnerQueue tasks are now run on the ThreadPool directly instead of our own custom thread, should have some threading implications
for user
- IMethodRunnerQueue now implements IDisposable

Resolves #2873
2019-09-06 11:05:18 +10:00
Alex Maitland fe98124c9b Async JavascriptBinding - Add support for returning Task (#2771)
* Async JavascriptBinding - Add support for returning Task

Remove Parallel Task execution code from MethodRunnerQueue
Add ParallelMethodRunnerQueue
  - For the new code path the Func is executed, if the Result is a generic Task we wait for it's completion
  - If the task is not generic then we return immediately

This is only enabled when CefSharpSettings.ConcurrentTaskExecution = true;
* MethodRunnerQueue - Display error message when method returns Task
* ParallelMethodRunnerQueue - Rename to ConcurrentMethodRunnerQueue
* MethodRunnerQueue - Improve formatting of error message when method returns Task
* Async JavascriptBinding Return Task - Add Basic xUnit Test

Very quick test, needs to be refined a little. The basics are working as expected.

* Add Binding Test Async Task Example to the WPF Example menu

* Async JSB Task - Add additional tests and improve error messaging
2019-06-08 17:21:49 +10:00
Chris bef5dd37c4 Maintenance - Fixed formatting, file encoding, and copyright year (#2504)
* Applied formatting

* Fixed file encoding + Updated copyright year

* Updated License

* Fixed more file encoding

* Copyright notice now shows the year the file was created
2018-09-10 10:41:13 +10:00
Chris 244aab0408 Fixed a deadlock and a possible race condition in MethodRunnerQueue
Resolves #2105
2017-08-30 23:48:23 +02:00
amaitland 767b478dc6 Add Experimental option where bound async methods are queued on TaskScheduler.Default.
Set `CefSharpSettings.ConcurrentTaskExecution = true;` to enable this feature, should be set before the first ChromiumWebBrowser instance is created.
2017-05-04 12:53:48 +10:00
Chris cd934267c6 Updated copyright year and made sure it used same format everywhere (#1966) 2017-03-06 08:44:37 +10:00
dga 86c3ec547e Target default scheduler to fix #1630 2016-03-17 21:58:14 +01:00
amaitland bae3c28e92 Update copyright to 2016 2016-01-11 14:11:30 +10:00
amaitland 2f3d9f868f Make js callbacks and async methods Frame aware - add FrameId so they can be executed on a specific frame
Resolves a problem where multiple contexts are created and only the first one is dealt with properly (each frame has it's own V8 context)
2015-10-11 20:41:17 +10:00
amaitland 8a8da5b35a Async JSB now working in popups
Still have the issue of callbacks not working as expect, for some reason it can't find the context
2015-09-24 20:08:15 +10:00
amaitland 562d6ea51c Catch OperationCanceledException otherwise VS will break (if you have break on user unhandled exceptions enabled)
Add in braces and extra lines (simple formating)
2015-08-03 14:52:58 +10:00
cefsharp-ms f804ca48ec added missing copyright notices 2015-07-31 17:17:04 +02:00
cefsharp-ms 5651aadd5b MethodRunnerQueue consumer thread modified to run tasks on the same thread instead of the threadpool. 2015-07-31 17:16:57 +02:00
cefsharp-ms bf08e671ff MethodRunnerQueue made a bit smarter 2015-07-23 15:13:12 +02:00
cefsharp-ms a8db666642 added async bound method result callback on browser process side 2015-07-23 15:12:28 +02:00
cefsharp-ms 7744b7197f async bindings are dispatched to a background thread for each browser 2015-07-23 15:12:05 +02:00