ApplicationRunner 'make' argument

#1

ApplicationRunner’s run method takes as its argument the class that creates an instance of ApplicationSession. Would it make sense to be abler to pass an already instantiated class? I make a couple of trivial changes to a copy of ApplicationSession:

factory for use ApplicationSession

def create():

cfg = ComponentConfig(self.realm, self.extra)

try:

if inspect.isclass(make):

session = make(cfg)

else:

session = make

Which allows me to call the run method with a class I’ve already started. Is this a bad idea?

-g

0 Likes

#2

ApplicationRunner's run method takes as its argument the class that
creates an instance of ApplicationSession. Would it make sense to be
abler to pass an already instantiated class? I make a couple of trivial
changes to a copy of ApplicationSession:

You can just do

ApplicationRunner.run(make = lambda _: session)

where session is your precreated session object.

···

Am 15.09.2014 02:37, schrieb Greg Fausak:

       ## factory for use ApplicationSession
       def create():
          cfg = ComponentConfig(self.realm, self.extra)
          try:
             if inspect.isclass(make):
                session = make(cfg)
             else:
                session = make

Which allows me to call the run method with a class I've already
started. Is this a bad idea?

-g

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
To post to this group, send email to autob...@googlegroups.com
<mailto:autob...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/autobahnws/380a6ef7-1a99-4959-8f62-9f64e350449c%40googlegroups.com
<https://groups.google.com/d/msgid/autobahnws/380a6ef7-1a99-4959-8f62-9f64e350449c%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#3

hadn’t thought of that :slight_smile:

thanks!

-g

···

On Mon, Sep 15, 2014 at 12:25 PM, Tobias Oberstein tobias.o...@gmail.com wrote:

ApplicationRunner’s run method takes as its argument the class that

creates an instance of ApplicationSession. Would it make sense to be

abler to pass an already instantiated class? I make a couple of trivial

changes to a copy of ApplicationSession:
Am 15.09.2014 02:37, schrieb Greg Fausak:

You can just do

ApplicationRunner.run(make = lambda _: session)

where session is your precreated session object.

   ## factory for use ApplicationSession

   def create():

      cfg = ComponentConfig(self.realm, self.extra)

      try:

         if inspect.isclass(make):

            session = make(cfg)

         else:

            session = make

Which allows me to call the run method with a class I’ve already

started. Is this a bad idea?

-g

You received this message because you are subscribed to the Google

Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send

an email to autobahnws+unsubscribe@googlegroups.com

mailto:autobahnws+unsub...@googlegroups.com.

To post to this group, send email to autob...@googlegroups.com

mailto:autobahnws@googlegroups.com.

To view this discussion on the web visit

https://groups.google.com/d/msgid/autobahnws/380a6ef7-1a99-4959-8f62-9f64e350449c%40googlegroups.com

<https://groups.google.com/d/msgid/autobahnws/380a6ef7-1a99-4959-8f62-9f64e350449c%40googlegroups.com?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to a topic in the Google Groups “Autobahn” group.

To unsubscribe from this topic, visit https://groups.google.com/d/topic/autobahnws/H6YUkIGrg48/unsubscribe.

To unsubscribe from this group and all its topics, send an email to autobahnws+unsubscribe@googlegroups.com.

To post to this group, send email to autob...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/autobahnws/54172108.9080309%40gmail.com.

For more options, visit https://groups.google.com/d/optout.


Greg Fausak
lgfa...@gmail.com

0 Likes