Giter VIP home page Giter VIP logo

xgen's People

Contributors

fishcakez avatar jwarwick avatar mrmargolis avatar rafaelfranca avatar timbuchwaldt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

xgen's Issues

Make server naming more consistent

Consider this:

def start_link(word_list) do
  GenServer.start_link __MODULE__, word_list, global: :anagrams 
end

def lookup(word) do
  GenServer.call {:global, :anagrams}, { :lookup, word }
​​end

The last parameter to start_list is global: :anagrams, a keyword list.

The first parameter to GenServer.call is a tuple.

This actually makes it slightly tricky to remove duplication.

GenEvent.stream/1 leaks messages when duration or timeout is not infinity

Once a stream has finished enumerating (due to a duration timeout or a event timeout) the GenEvent handler is removed. However there can be messages from that handler in the message queue. Given that a spawn is always used in examples and tests is this intentionally not resolved? A flush could be used after removing the handler:

defp flush(ref) do
  receive do
    { ^ref, _ } -> flush(ref)
  after
    0 -> nil
  end
end

Task.find/2 exit reason has wrong mfa and stacktrace

Currently Task.find/2 exit with reasons {reason, {Task, :await, [task,0]}} but this is not the correct mfa.

OTP functions like :gen_server.call/2 exit in the function called so that the mfa matches the head of the stacktrace. It would be nice to do this too for Task.find/2 and perhaps elsewhere in xgen.

Task.Node

Tasks can only be created on other nodes if they are supervised. Could xgen provide a task supervisor on each node started with:

Task.Sup.start_link(local: Task.Node)

Task.Node would have the Task.Sup API (except no documented start_link) but take a node name as the first argument instead of a pid/name. For example:

Task.Node.async(node_name, fn() -> :ok end)

Implemented as:

defp async(node_name, task)  do
  Task.Sup.async({__MODULE__, node_name}, task)
end

This would allow :rpc like functionality "for free" on all nodes.

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.