title: multiprocessing.Pool().apply_async() doesn't seem to run my function
body: <p>I'm trying to run 2 functions over two differents process with the help of multiprocessing.Pool().apply_async() , but it doesn't seem to run my function. No error messages tho.
  But when I try my function without multiprocessing then it works perfectly.
  Here is how my code looks like(short version) :</p>
  <pre><code>import multiprocessing, twitch_integration
  p = multiprocessing.Pool()
  p.apply_async(twitch_integration.get_user_followers, args=(userid1, &quot;&quot;, conn,))
  p.apply_async(twitch_integration.get_user_followers, args=(userid2, &quot;&quot;, conn,))
  p.close()
  p.join()
  </code></pre>
  <p>I don't know if it's important to note, but get_user_followers function is recursive and requests module.
  I've put a print at the very beginning of get_user_followers, but it doesn't print anything.</p>
  <p>I've been searching for the last 4 hours, I'm not exaggerating. If anyone could help me I would be very thankful.
  Thank you.</p>
  <p>After asking for the results as @Steve mentioned, it raised a new error and here is the traceback :</p>
  <pre><code>Traceback (most recent call last):
    File &quot;main.py&quot;, line 89, in &lt;module&gt;
      main(conn, cursor);
    File &quot;main.py&quot;, line 68, in main
      r = result.get(timeout=1)
    File &quot;C:\Python38\lib\multiprocessing\pool.py&quot;, line 771, in get
      raise self._value
    File &quot;C:\Python38\lib\multiprocessing\pool.py&quot;, line 537, in _handle_tasks
      put(task)
    File &quot;C:\Python38\lib\multiprocessing\connection.py&quot;, line 206, in send
      self._send_bytes(_ForkingPickler.dumps(obj))
    File &quot;C:\Python38\lib\multiprocessing\reduction.py&quot;, line 51, in dumps
      cls(buf, protocol).dump(obj)
    File &quot;C:\Python38\lib\socket.py&quot;, line 272, in __getstate__
      raise TypeError(f&quot;cannot pickle {self.__class__.__name__!r} object&quot;)
  TypeError: cannot pickle 'SSLSocket' object
  </code></pre>
  <p>Here is the get_user_followers function for more details(I know it's ugly but I'm getting started with Python and programmation):</p>
  <pre><code>import requests, json, sys, time
  from mysql.connector import Error
  def get_user_followers(user_id, pagination, conn):
      global FOLLOWER_COUNT
      global ERROR_COUNT
      global OAUTH_TOKEN
      global TOTAL_FOLLOWER
      global ERROR_IN_A_ROW
      print(&quot;YES&quot;)
      after = &quot;&amp;after={0}&quot;.format(pagination)
      first = &quot;&amp;first=100&quot;
      query = 'users/follows?to_id={0}{1}{2}'.format(user_id, first, pagination if pagination == &quot;&quot; else after)
      try:
          response = get_response(query)
      except requests.exceptions.RequestException as e:
          print(&quot;pause 1 seconde. . . Retrying same request&quot;)
          time.sleep(1)
          print(&quot;Request error: &quot;, e)
          get_user_followers(user_id, pagination, conn)
          return
      finally:
          pass
      if response.status_code == 200:
          ERROR_IN_A_ROW = 0
      elif response.status_code == 401:
          print(response.json())
          print(&quot;HTTP Error 401&quot;)
          ERROR_IN_A_ROW += 1
          if ERROR_IN_A_ROW == 3:
              print(&quot;AFTER 3 HTTP ERROR IN A ROW - EXITING PROGRAM&quot;)
              print(&quot;pagination: &quot;, pagination, &quot; user_id&quot;, user_id)
              return
          OAUTH_TOKEN = requests.post(POST_URL, data=POST_PARAMS).json()['access_token']
          get_user_followers(user_id, pagination, conn)
          return
      elif response.status_code == 429:
          print(response.json())
          print(&quot;HTTP Error 429&quot;)
          time.sleep(int(response.json()['Ratelimti-Reset']))
          get_user_followers(user_id, pagination, conn)
          return
      else:
          print(response.json())
          print(&quot;HTTP Error {0}&quot;.format(response.status_code))
          ERROR_IN_A_ROW += 1
          if ERROR_IN_A_ROW == 3:
              print(&quot;AFTER 3 HTTP ERROR IN A ROW - EXITING PROGRAM&quot;)
              print(&quot;pagination: &quot;, pagination, &quot; user_id&quot;, user_id)
              return
          get_user_followers(user_id, pagination, conn)
          return
      response = response.json()
      TOTAL_FOLLOWER = response['total']
      length = len(response['data'])
      if length == 0:
          try:
              print(&quot;{0}/{1}&quot;.format(FOLLOWER_COUNT, TOTAL_FOLLOWER) + &quot; ({0}%)&quot;.format(format((FOLLOWER_COUNT * 100 / TOTAL_FOLLOWER), &quot;.2f&quot;)) + &quot;\r&quot;, end=&quot;&quot;)
          except:
              print(&quot;{0}/{1}&quot;.format(FOLLOWER_COUNT, TOTAL_FOLLOWER))
          FOLLOWER_COUNT = 0
          ERROR_COUNT = 0
          TOTAL_FOLLOWER = 0
          return 1
      pagination = response['pagination']['cursor']
      i = 0
      while i &lt; length:
          try:
              conn.cursor().execute(&quot;&quot;&quot;INSERT INTO user (id, username) VALUES ({0}, '{1}')&quot;&quot;&quot;.format(response['data'][i]['from_id'], str(response['data'][i]['from_name'])))
          except Error as e:
              print(&quot;An error has occured : &quot;, e)
              ERROR_COUNT += 1
          finally:
              pass
          i += 1
          FOLLOWER_COUNT += 1
          try:
              print(&quot;{0}/{1}&quot;.format(FOLLOWER_COUNT, TOTAL_FOLLOWER) + &quot; ({0}%)&quot;.format(format((FOLLOWER_COUNT * 100 / TOTAL_FOLLOWER), &quot;.2f&quot;)) + &quot; {0}&quot;.format(user_id))
          except:
              print(&quot;{0}/{1}&quot;.format(FOLLOWER_COUNT, TOTAL_FOLLOWER))
      get_user_followers(user_id, pagination, conn)
  </code></pre>