Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to call multiple different methods simultaneously
    text
    copied!<p>I have some different methods that each import products from different sites. If I execute these sequentially the entire process takes a lot of time, particularly when 1 method is running on a site that is less responsive.</p> <p>I'd rather run them simultaneously.</p> <p>This is what I have so far with 1 example method:</p> <pre><code>Public Class feedParameters Private _productIdPrefix As String Private _publishersite As String Private _feedURL As String Public Property productIdPrefix() As String Get Return _productIdPrefix End Get Set(value As String) _productIdPrefix = value End Set End Property Public Property publishersite() As String Get Return _publishersite End Get Set(value As String) _publishersite = value End Set End Property Public Property feedURL() As String Get Return _feedURL End Get Set(value As String) _feedURL = value End Set End Property End Class Dim fpm As New feedParameters fpm.publishersite = "mypublisher.nl" fpm.feedURL = "http://www.domain.com/test.xml" fpm.productIdPrefix = "10" Protected Sub ImportProductsPublisherA(ByVal productIdPrefix As String, ByVal publishersite As String, ByVal feedURL As String) End Sub </code></pre> <p>I tried this:</p> <pre><code>System.Threading.ThreadPool.QueueUserWorkItem(New System.Threading.WaitCallback(AddressOf ImportProductsPublisherA()), fpm) </code></pre> <p>Then I get 3 errors that I have not specified arguments for the 3 parameters: productIdPrefix, publishersite and feedURL </p> <p>I also tried: </p> <pre><code>System.Threading.ThreadPool.QueueUserWorkItem(New System.Threading.WaitCallback(AddressOf ImportProductsPublisherA), fpm) </code></pre> <p>I get this error: Method 'Protected Sub ImportProductsPublisherA(productIdPrefix As String, publishersite As String, feedURL As String)' does not have a signature compatible with delegate 'Delegate Sub WaitCallback(state As Object)'. </p> <p>Any help is greatly appreciated!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload