+ Reply to Thread
Results 1 to 4 of 4

Thread: Using Dream for REST API of a stateful service

  1. #1
    Join Date
    Jun 2008
    Location
    San Diego, CA
    Posts
    2

    Question Using Dream for REST API of a stateful service

    I have a stateful daemon to which I'd like to add a REST api to check status, and allow some manipulation. Looking at the various examples, it seems that Dream is always hosted. Is there a way to just embed the REST engine so that I can have the requests running in the same process with access to the daemon's state objects?

    thanks,
    arne
    Last edited by sdether; 06-24-2008 at 05:15 PM.

  2. #2
    Join Date
    Jul 2006
    Location
    San Diego, CA
    Posts
    5,450

    Default

    You can run Dream inside any process. It doesn't have to be hosted independently, although that's the most common configuration.
    Steve G. Bjorg - Chief Architect
    Did you check the MindTouch FAQ?
    Found a bug? Report it.
    Follow me on Twitter
    Find us on IRC: irc.freenode.net #mindtouch

  3. #3
    Join Date
    Jun 2008
    Location
    San Diego, CA
    Posts
    2

    Default

    Steve,

    I haven't dug into the architecture, but going through the embedded example, it seemed that it just embedded the host, but still dynamically loaded the service. Is there a way to host a service class already in the current appdomain? And once a service is loaded, can i access the instance, so that I can wire it up to my daemon's message pump?

    Ideally, I'd like to create the service via my existing IoC infrastructure and then just hand it to DreamHost to be hosted.

    thanks,
    arne

  4. #4
    Join Date
    Jul 2006
    Location
    San Diego, CA
    Posts
    5,450

    Default

    Hmm, yeah, I don't think that will work. The DreamHost assumes that it's responsible for creating and destroying the service. So you can't just hook up an existing instance. However, you could create a "facade" service that is created by DreamHost and then connects to your actual instance. The way to create the connection would be done by passing some information in the config XML document that enables the service to locate your existing instance.
    Steve G. Bjorg - Chief Architect
    Did you check the MindTouch FAQ?
    Found a bug? Report it.
    Follow me on Twitter
    Find us on IRC: irc.freenode.net #mindtouch

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts