going to answer my own question for the sake of anyone who runs into things while learning python:
I needed channel redis that can pass messages from one process to another. redis is just a key/value storage server that you can install in ubuntu. On Wednesday, January 8, 2020 at 8:22:11 PM UTC-8, Jeremy Wai wrote: > > I got a heroku server running on one web processing, in the routing.py I > have > > application = ProtocolTypeRouter({ > 'websocket': backEndConsumer, > 'http': frontEndConsumer, > }) > > my frontEndConsumer handles the http webhook requests and my > backEndConsumer handles all my websocket requests. > > When a device with the correct address tries to talk to my websocket, it > will go to backEndConsumer and run the websocket_connect() > Then on my frontEndconsumer, It will get a http_request(). > > I want this http_request() to trigger the backEndConsumer to do a > websocket_send(). I can't seem to get that to work. > > webhook.py > scope = None > import myapp.consumers > > class frontEndConsumer(AsyncHttpConsumer): > async def http_request(self, request): > > myapp.consumers.backEndConsumer.frontSend(myapp.consumers.scope) > await self.send_response(200, b"finished", > headers=[(b"Content-Type", b"text/plain"),]) > > consumers.py > > class backEndConsumer(AsyncJsonWebsocketConsumer): > async def websocket_connect(self, type): > await self.accept() > global scope > scope = self # doing this to pass the object to > frontEndConsumer > async def frontSend(self): > await self.send("Hello world!") > > I keep getting this error > myapp.consumers.backEndConsumer.frontSend() > frontSend() missing 1 required positional argument: 'self' > I know I am doing something wrong, but I am not sure how to do what I want. > > > > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0ebae823-dcd8-40db-ab99-fc9f88109963%40googlegroups.com.