Release 1. Documentation Concurrent Ruby Modern concurrency tools for Ruby. The design goals of this gem are: Be an 'unopinionated' toolbox that provides useful utilities without debating which is better or why Remain free of external gem dependencies Stay true to the spirit of the languages providing inspiration But implement in a way that makes sense for Ruby Keep the semantics as idiomatic Ruby as possible Support features that make sense in Ruby Exclude features that don't make sense in Ruby Be small, lean, and loosely coupled Thread-safety Backward compatibility Contributing This gem depends on contributions and we appreciate your help.
Versioning concurrent-ruby uses Semantic Versioning concurrent-ruby-ext has always same version as concurrent-ruby concurrent-ruby-edge will always be 0. Anything may change at any time. The public API should not be considered stable. ScheduledTask : Like a Future scheduled for a specific future time. TimerTask : A Thread that periodically wakes up to perform work at regular intervals.
Promises : Unified implementation of futures and promises which combines features of previous Future , Promise , IVar , Event , dataflow , Delay , and partially TimerTask into a single framework. It extensively uses the new synchronization layer to make all the features non-blocking and lock-free , with the exception of obviously blocking operations like wait , value. It also offers better performance. Hash A thread-safe subclass of Ruby's standard Hash. Set A thread-safe subclass of Ruby's standard Set.
Map A hash-like object that should have much better performance characteristics, especially under high concurrency, than Concurrent::Hash. Value objects inspired by other languages: Maybe A thread-safe, immutable object representing an optional value, based on Haskell Data. Structure classes derived from Ruby's Struct : ImmutableStruct Immutable struct where values are set at construction and cannot be changed later.
MutableStruct Synchronized, mutable struct where values can be safely changed at any time. SettableStruct Synchronized, write-once struct where values can be set at most once, either at construction or any time thereafter. Thread-safe variables: Agent : A way to manage shared, mutable, asynchronous , independent state.
Based on Clojure's Agent. Atom : A way to manage shared, mutable, synchronous , independent state. Based on Clojure's Atom. AtomicBoolean A boolean value that can be updated atomically.
AtomicFixnum A numeric value that can be updated atomically. AtomicReference An object reference that may be updated atomically. Exchanger A synchronization point at which threads can pair and swap elements within pairs.
For up-to-date information on how asdf works and the other features, refer to the project website. Asdf creates a. There are benefits to checking this file in with your project.
It can help ensure everyone is using the same version of Elixir and Erlang for the project. Just be aware that it may also be tracking the version of Node. You may want to discuss it as a team before checking it in as it could override personal preferences.
This is a good idea to do whenever you change your active Elixir or Erlang versions. This contains compiled code for your project that ElixirLS uses to give code insight. To avoid potential issues, delete that directory to get a clean start. Did you notice when you run asdf list-all elixir that the last Elixir version listed is master?
After playing on the master branch, you can easily change back to the Elixir version you do day-to-day development with. The list of available asdf plugins is quite impressive! Many of them are community contributed. Check it out. Full list of plugins. If you are already using a language version manager like nvm for Node. When installing a plugin, it may be worth paying attention to the Github account that maintains it. The Elixir and Erlang plugins are maintained by the asdf-vm team. With a solid install of Elixir and Erlang, you are ready to get your coding environment setup too.
Are you learning Elixir? Check out my courses to help you make the mental shifts faster and easier! This guide uses asdf to do this as well. The next sections assume you are already using asdf. Just skip those sections if you already have Elixir 1. Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then asdf is your best friend. If you want Erlang to generate its docs when compiling, or if you need the jinterface or the ODBC applications, then you may need to install some extra dependencies.
The Erlang compilation script simply skips these if dependencies are not met, so all of this is optional. For Ubuntu and derivatives these dependencies seem to be the java and javac to be installed, and:. Use asdf. Skip to content. Install locations determined by configure will be used.
Reading man pages. Make sure that erl is referring to the installed version. Try viewing at the man page for Mnesia. Pre-formatted html documentation and man pages can be downloaded from. The configure script will figure this out and set it in the top level Makefile which, when building, it will pass on.
However, when developing it is sometimes convenient to be able to run make in a subdirectory. The configure script is created by the GNU autoconf utility, which checks for system specific features and then creates a number of makefiles. The configure script allows you to customize a number of parameters; type.
If you or your system has special requirements please read the Makefile for additional configuration information. Generated configure scripts are nowadays included in the git repository. If you modify any configure. First ensure that you have GNU autoconf of version 2. Then execute. By default the VM will refuse to build if native atomic memory operations are not available. Such a configuration should only be used as a last resort.
If you've upgraded the source with a patch you may need to clean up from previous builds before the new build. Make sure to read the Pre-built Source Release section below before doing a make clean.
0コメント