Can we use websocket of market feed ,websocket of order update at same time

websocket of market feed was running fine , then i placed a order and websocket of order update got triggered ,(they both are from same access token ,algo) but after order update ,market feed was not coming from websocket ,how to solve this?

im using this for websocket connection:

def start_websocket():
config = Configuration()
config.access_token = access_token
streamer = MarketDataStreamer(
ApiClient(config), instrument_keys, ‘ltpc’)
if not simulator_switch:
streamer.on(‘message’, on_message)
streamer.on(“open”,on_open)
streamer.connect()

streamer2 = PortfolioDataStreamer(
    ApiClient(config))

streamer2.on("message", on_order)
streamer2.connect()

return(streamer,streamer2)

@Vibhuvan_Krishna, you can indeed receive messages from both WebSocket connections simultaneously.
A straightforward approach is to separate the market WebSocket code into a file, say market.py, and the order update WebSocket code into another file, order.py.

  • To receive market updates, run the command python3 market.py in the terminal.
  • Then, open a new terminal window and run the command python3 order.py to receive order updates.

thanks for reply sir ,but my algorithim needs both websockets in same file ,basically i want to confirm order placement from websocket of order update,and continue with market data feed, is there any way for this ,like using threading or any other way