Skip to content

Commit

Permalink
SocketModeClient expose async event loop param (#1609)
Browse files Browse the repository at this point in the history
  • Loading branch information
jantman authored Dec 5, 2024
1 parent cc070d3 commit 8b8085e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion slack_sdk/socket_mode/aiohttp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import asyncio
import logging
import time
from asyncio import AbstractEventLoop
from asyncio import Future, Lock
from asyncio import Queue
from logging import Logger
Expand Down Expand Up @@ -79,6 +80,7 @@ def __init__(
on_message_listeners: Optional[List[Callable[[WSMessage], Awaitable[None]]]] = None,
on_error_listeners: Optional[List[Callable[[WSMessage], Awaitable[None]]]] = None,
on_close_listeners: Optional[List[Callable[[WSMessage], Awaitable[None]]]] = None,
loop: Optional[AbstractEventLoop] = None,
):
"""Socket Mode client
Expand Down Expand Up @@ -124,7 +126,7 @@ def __init__(
# over the lifetime of your application,
# it is suggested you use a single session for the lifetime of your application
# to benefit from connection pooling.
self.aiohttp_client_session = aiohttp.ClientSession()
self.aiohttp_client_session = aiohttp.ClientSession(loop=loop)

self.on_message_listeners = on_message_listeners or []
self.on_error_listeners = on_error_listeners or []
Expand Down

0 comments on commit 8b8085e

Please sign in to comment.