Giter VIP home page Giter VIP logo

Comments (8)

tarcieri avatar tarcieri commented on July 28, 2024

I'm guessing this is a limitation of the present block implementation /cc @halorgium

from reel.

halorgium avatar halorgium commented on July 28, 2024

The main issue here is the supervisor implementation, it sometimes uses blocks for configuration which show this error in exclusive mode.
Is there a reason you are using an exclusive block? I am guessing there is more surrounding code.

from reel.

kostya avatar kostya commented on July 28, 2024

just found

exclusive :start_server

this is works, thanks.

from reel.

kostya avatar kostya commented on July 28, 2024

bug remains when call method directly

require 'bundler/setup'
require 'reel'
require 'celluloid'

class A
  include Celluloid

  exclusive :start_server

  def run
    start_server
  end

  def start_server
    @server = Reel::Server.supervise('127.0.0.1', 12345) do |connection|
      while request = connection.request
        connection.respond(Reel::Response.new(:ok, "Hello world"))
      end
    end
  end
end

when

a = A.new
a.run
sleep

all is ok

when

a = A.new
a.start_server
sleep

Cannot execute blocks on sender in exclusive mode

from reel.

tarcieri avatar tarcieri commented on July 28, 2024

@kostya can you try master of both Celluloid and Reel? There were some bugs in the block changes where it wasn't being reflected by Reel.

Reel's block (the one passed to initialize) should get called on Reel itself, not "A", but that's what appears to be happening.

from reel.

kostya avatar kostya commented on July 28, 2024

on master all the same, run works, start_server fails.

except that, when stopping run script, got (if it matter)

[2013-08-13T00:34:25.732398 #7571] DEBUG -- : Terminating 7 actors...
D, [2013-08-13T00:34:25.748397 #7571] DEBUG -- : Discarded message (mailbox is dead): #<Celluloid::ExitEvent:0x86672b0>
D, [2013-08-13T00:34:25.749087 #7571] DEBUG -- : Discarded message (mailbox is dead): #<Celluloid::TerminationRequest:0x8667738>
D, [2013-08-13T00:34:25.754866 #7571] DEBUG -- : Discarded message (mailbox is dead): #<Celluloid::TerminationRequest:0x8667990>
D, [2013-08-13T00:34:25.755403 #7571] DEBUG -- : Discarded message (mailbox is dead): #<Celluloid::ExitEvent:0x8667968>
D, [2013-08-13T00:34:25.757106 #7571] DEBUG -- : Discarded message (mailbox is dead): #<Celluloid::TerminationRequest:0x8666360>
W, [2013-08-13T00:34:25.757695 #7571]  WARN -- : Terminating task: type=:call, meta={:method_name=>:run}, status=:iowait
D, [2013-08-13T00:34:25.758461 #7571] DEBUG -- : Discarded message (mailbox is dead): #<Celluloid::ExitEvent:0x86661d0>
12.rb:26:in `sleep': Interrupt
    from 12.rb:26:in `<main>'

from reel.

tarcieri avatar tarcieri commented on July 28, 2024

It's odd you would get this error on master as Reel is specifically configured to execute its #initialize block on itself:

https://github.com/celluloid/reel/blob/master/lib/reel/server.rb#L8

/cc @halorgium any ideas?

from reel.

tarcieri avatar tarcieri commented on July 28, 2024

@kostya can you open an issue on Celluloid instead, if the issue persists in Celluloid 0.15?

from reel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.