cadence | highly available orchestration engine to execute | Microservice library

 by   uber Go Version: v1.0.0 License: MIT

kandi X-RAY | cadence Summary

kandi X-RAY | cadence Summary

cadence is a Go library typically used in Architecture, Microservice applications. cadence has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

This repo contains the source code of the Cadence server and other tooling including CLI, schema tools, bench and canary. You can implement your workflows with one of our client libraries. The Go and Java libraries are officially maintained by the Cadence team, while the Python and Ruby client libraries are developed by the community. See Maxim's talk at Data@Scale Conference for an architectural overview of Cadence.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              cadence has a medium active ecosystem.
              It has 6910 star(s) with 699 fork(s). There are 1495 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 342 open issues and 1088 have been closed. On average issues are closed in 571 days. There are 37 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of cadence is v1.0.0

            kandi-Quality Quality

              cadence has 0 bugs and 0 code smells.

            kandi-Security Security

              cadence has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              cadence code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              cadence is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              cadence releases are available to install and integrate.
              Installation instructions are available. Examples and code snippets are not available.
              It has 307289 lines of code, 17514 functions and 1063 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cadence
            Get all kandi verified functions for this library.

            cadence Key Features

            No Key Features are available at this moment for cadence.

            cadence Examples and Code Snippets

            No Code Snippets are available at this moment for cadence.

            Community Discussions

            QUESTION

            Get all NFTs of an Account on Flow Blockchain
            Asked 2022-Mar-24 at 06:20

            Can I get a list of all NFTs to an account on the Flow Blockchain? There is account storage and the documentation says

            ...Cadence represents each NFT as a resource object that users store in their accounts...

            Or does the respective user has to have a dedicated collection in order to allow others to have a look at their NFTs?

            ...

            ANSWER

            Answered 2022-Mar-24 at 06:20

            To obtain all NFTs under a user account, the following conditions are required:

            1. A collection needs to be created under the account to store NFT.
            2. The collection provides a public method to query its NFT list.

            Source https://stackoverflow.com/questions/70214436

            QUESTION

            How to pass workflow.Context to the Cadence activity
            Asked 2022-Mar-07 at 18:13

            I would like to put workflow.Sleep call in one of my Cadence activities to be able to test it properly (and simulate error result coming from Sleep function).

            Two important things which I noticed before implementing:

            My tries:

            1. First try

            ...

            ANSWER

            Answered 2022-Mar-07 at 18:13

            Is it possible to use workflow.Sleep inside any activity?

            No, it's NOT allowed to use workflow.Sleep in activity code.

            Workflow.Sleep is only allowed in workflow code. More general, all the APIs in workflow package are ONLY allowed in workflow code.

            The workflow code will be executed within decision task, and the workflow threads/coroutines(special kind of goroutines) are managed by Cadence. This is how those APIs in workflow package works. Without decision tasks and workflow threads/coroutines, those API won't work properly.

            The activity code on the other hand, is just purely normal code that you should use regular native library or dependency to implement the logic. For example, you can use time.Sleep in activity code.

            Source https://stackoverflow.com/questions/71383875

            QUESTION

            How to pass the yaml property to Uber Cadence cronSchedule annotation
            Asked 2022-Jan-04 at 17:56

            I am new to uber Cadence and trying to write a cron scheduled task. Cadence provided a cronSchedule annotation (find an example online) which takes a cron expression string for the method to be triggered at specific time. However, I want this cron expression to be loaded according to what we set in the yml file. Is there any way to do it? I currently only found this @cronSchedule annotation way to do it. I also found there is a WorkflowOption that I can set the cronSchedule. However, don't know how to use it to trigger the method. Below is the current code.

            ...

            ANSWER

            Answered 2022-Jan-04 at 17:56

            In Temporal you can do it through WorkflowOptions:

            Source https://stackoverflow.com/questions/70527143

            QUESTION

            The lifetime of systemverilog method in the program block
            Asked 2021-Dec-21 at 19:36
            `define NUM 100
            program test;
              function automatic int sum(int n);
                if(n <= 1) 
                  return n;
                else 
                  return n + sum(n-1);          
              endfunction
              
              initial begin
                $display("sum(%0d)=%d",`NUM, sum(`NUM)); 
                
              end
            
            endprogram
            
            
            ...

            ANSWER

            Answered 2021-Dec-21 at 16:16

            The differences you are seeing are not due to the lifetime of the sum method—it's the order of evaluation of function calls within the expression n + sum(n-1), which is indeterminate. If you reverse the expression to sum(n-1) + n, all tools give the correct result for a function with a static lifetime.

            BTW, I strongly recommend that you never use program blocks in SystemVerilog. Use modules instead.

            Source https://stackoverflow.com/questions/70434519

            QUESTION

            How to format SQL Queries inside PySpark codefile
            Asked 2021-Dec-01 at 13:24

            I would like to format my existing SQL queries inside the PySpark file.

            This is how my existing source file looks like:

            ...

            ANSWER

            Answered 2021-Dec-01 at 09:00

            One of the possible options is to use sql-formatter.

            Let's say we have a test.py file:

            Source https://stackoverflow.com/questions/70181180

            QUESTION

            Scaling limitation of workflow workers due to continuous polling in Uber Cadece?
            Asked 2021-Nov-20 at 16:50

            I am evaluating cadence for implementing our business orchestration. I understand that the workers continuously poll the task list for tasks to execute. My concern here is that will it cause any scale problems? The worker is always busy and continuously polling some database, along with this it also needs to execute the business logic so is there a possibility that it runs out of resources and then crashes or drops the tasks to execute?

            How does this polling mechanism scale when we have millions of workflows? Will it cause delays in executing the workflow code, when we have millions of tasks in the task list?

            ...

            ANSWER

            Answered 2021-Nov-18 at 02:39

            Cadence and Temporal use long polling over gRPC to listen to task queues. So if there are no messages in the queues the poll requests return once per minute. This way workers don't consume excessive resources due to polling. Also, most poll calls never cause a call to the database due to various optimizations the matching service implements.

            The number of open workflows doesn't affect polling performance at all as many of these workflows can be passively waiting on a timer on an external event. The number of operations per second that workflows execute defines how many tasks have to be delivered to workers. If the cluster and workers are provisioned correctly then even a high rate of tasks shouldn't cause any issues.

            Source https://stackoverflow.com/questions/70004693

            QUESTION

            AssetLinks file expected traffic and failure scenarios
            Asked 2021-Nov-01 at 17:08

            I am working on setting up my Android app to work with HTTP Web Links according to the various guides and protocols and have successfully setup the deeplinks which includes serving my assetlinks file from /.well-known/assetlinks.json. Everything is working as expected. What I am struggling with from an operational perspective is how to go about maintaining this file -- specifically during update and failure scenarios.

            Let's say I have existing customers who have downloaded my app and are using weblinks just fine. I update my assetlink file and push the new version to my server. When do my customers get the updated assetlink file? Is the OS configured to check for updates on some cadence or app launch? Is it only on app update or reinstall?

            Similarly, imagine my website is down. New users are installing my app and the OS will not be able to associate my domain and when customers click the HTTP web links they will not be deeplinked into the app. This makes sense. But after I recover from my outage when will the customer get their assetlink file given the app is already installed?

            Similarly lets say I upload an invalid assetlinks.json file. Will this break the current web links for existing customers who already had a valid association when they first installed the app?

            Understanding these issues will ultimately help me better troubleshoot customer issues and tune the expected traffic I should expect to see for my assetlinks file from my server.

            ...

            ANSWER

            Answered 2021-Nov-01 at 17:08

            Let me try to briefly put down how app linking works. I'm listing down all the things which I have learned gathered while playing with app links. Also attaching a very good article which covers in more details about the following.

            There are two key components in registering and updating app links: Package manager and Intent Filter Verifier. These are the usual steps in which the workflow runs:

            1. Every time an app is installed or updated through the package manager an intent named INTENT_FILTER_NEEDS_VERIFICATION is generated.

            2. The Intent Filter Verifier looks up the domains specified in the tags defined in the manifest of your app.

            3. For every domain/hostname specified for the app, the IntentFilterVerfier tries to fetch statements for each of the domain using an API call.

              • A sample API call for the domain google.com looks like this
              • The APIs documentation of this is carefully hidden by google at Digital Asset Links
            4. Based on the result of the API call, the domain/hostname is categorized into one of the following buckets

            Source https://stackoverflow.com/questions/69744408

            QUESTION

            How to indent flow/cadence files in vim correctly
            Asked 2021-Oct-26 at 21:11

            In cadence a resource interface can contain state and methods that needs to be implemented. However when I try to indent a cadence file in vim it will indent the code wrong.

            ...

            ANSWER

            Answered 2021-Oct-26 at 21:11

            Update: The maintainer has merged a request after we had a discussion that fixes a lot of my issues with this.

            Source https://stackoverflow.com/questions/68613776

            QUESTION

            Temporal / Cadence orchestration concept
            Asked 2021-Sep-22 at 00:32

            In current application, we have three services:

            • invoice
            • bank transfer : calls external API, which might takes a minute or so depends on queue
            • ledger : internal microservice that create debit-credit ledger

            To communicate, we have an orchestration saga. The flow is basically using invoice as the orchestrator:

            1. invoice service publish message to rabbitmq, asking payment for invoice X
            2. bank transfer service listen message, get invoice X
            3. bank transfer service process the transfer (calls bank's API). When payment success, publishing message to rabbitmq that 'Invoice X paid'
            4. invoice service listen the message 'Invoice X paid'
            5. Invoice service publish message 'Create ledger for invoice X' and publish to rabbitmq
            6. ledger service listen from rabbitmq for message 'Create ledger for invoice X'
            7. ledger service create appropriate ledger journal debit / credit, then publish 'ledger created for invoice X'
            8. Invoice service listen for message 'ledger created for invoice X', then finalize (close) the transaction

            Question 1 If I'm using Temporal or cadence (just looking for it), they doesn't rely on pub-sub pattern like above. So how do I implement it?

            I'm thinking (CMIIW) :

            • create InvoiceActivity
            • create BankTransferActivity
            • create LedgerActivity
            • create InvoicePaymentWorkflow

            All of those Workflow and Activity are part of invoice service app. But instead of relying on pub-sub, the bank transfer service and ledger service now provides API to process transfer (in term of bank transfer, it acually a proxy API to external bank calll), and ledger service provides API to create debit/credit journal. CMIIW, in this case, we no longer need creating listener (or cadence / temporal activity) on bank transfer service and ledger service, we need to provides API.

            OR I'm thinking it wrong? There should be some activity on bank transfer service and ledger service? But if so, how can the invoice service trigger and arrange the workflow?

            Question 2 But now the call is asynchronous. The journal ledger creation actually has some validation, and heavy load at times, so depends on message on queues, it can take up to 5 minutes from the message goes to rabbitmq until journal actually created. On API call, this will be a timeout.

            Question 3 And what about the race condition? Some journals to be created in sequence. Using rabbitmq, we can achieve this with certain technique (single consumer on queue, something like kafka topic).

            Question 4 Also, how to handle the compensating transaction? If ledger failed, we must do something. In our case, we must notify somebody on accounting, since bank transfer already processed and cannot reversed.

            Question 5 For some subsidiariy companies, when ledger failed, we still has control, so we can compensate / withdraw the invoice amount, and return the amount back to parent company. Suppose we have a listener for this on the bank transfer service, how can we trigger the compensation API?

            In cadence / Temporal, is this suitable usecase? If so, how to handle those issues above?

            Thanks

            ...

            ANSWER

            Answered 2021-Sep-21 at 19:58

            TLDR; This use case is the perfect fit for Temporal as it greatly simplifies your code and operations.

            Question 1

            I would recommend hosting activities in their correspondent services. So InvoiceActivity should be hosted by the invoice service and BankTransferActivity be hosted by the bank transfer service. This eliminates the need for creating synchronous APIs and ensures flow control between workflow and activity implementation. See this post that explains this in more detail.

            The invoice service app would host the workflow code only in this case.

            Question 2

            Hosting activity in the corresponding service solves this issue. Temporal supports activities of unlimited duration. Note that heartbeating is recommended for long-running activities to ensure timely failure detection.

            Question 3

            The exact solution depends on the exact requirements. In the majority of cases, the journal entries that require specific sequencing should be orchestrated from a single workflow.

            Question 4

            Temporal by ensuring that the workflow code eventually completes makes it trivial to support compensating actions. Here is a SAGA example from Java SDK Samples repository.

            Question 5

            Just make this compensation logic part of the same workflow.

            Source https://stackoverflow.com/questions/69267865

            QUESTION

            How to do Down casting between same extended classes in systemverilog?
            Asked 2021-Sep-16 at 15:14

            I'm trying to understand about case between same extended class in uvm as example below,

            ...

            ANSWER

            Answered 2021-Sep-16 at 14:02

            you have the following scheme:

            Source https://stackoverflow.com/questions/69207010

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install cadence

            The tools are for manual setup or upgrading database schema. The easiest way to get the schema tool is via homebrew. brew install cadence-workflow also includes cadence-sql-tool and cadence-cassandra-tool.
            If server runs with Cassandra, Use Cadence Cassandra tool
            If server runs with SQL database, Use Cadence SQL tool
            The schema files are located at /usr/local/etc/cadence/schema/.
            To upgrade, make sure you remove the old ElasticSearch schema first: mv /usr/local/etc/cadence/schema/elasticsearch /usr/local/etc/cadence/schema/elasticsearch.old && brew upgrade cadence-workflow. Otherwise ElasticSearch schemas may not be able to get updated.
            Follow the instructions if you need to install older versions of schema tools via homebrew. However, easier way is to use new versions of schema tools with old versions of schemas. All you need is to check out the older version of schemas from this repo. Run git checkout v0.21.3 to get the v0.21.3 schemas in the schema folder.

            Support

            Github Discussion Best for Q&A, support/help, general discusion, and annoucementStackOverflow Best for Q&A and general discusionGithub Issues Best for reporting bugs and feature requestsSlack Best for contributing/development discussion
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link