Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8969507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:36:03+00:00 2026-06-15T17:36:03+00:00

Having trouble with this code: let subscribe (nm : NamespaceManager) (subName : string) (desc

  • 0

Having trouble with this code:

  let subscribe (nm : NamespaceManager) (subName : string) (desc : TopicDescription)  : Async<SubscriptionDescription> =
    let rec first_create () =
      async {
        let! exists = desc |> exists nm
        if exists then return! (then_create_subscription () : Async<SubscriptionDescription>)
        try
          let beginCreate = nm.BeginCreateTopic : string * AsyncCallback * obj -> IAsyncResult
          logger.DebugFormat("creating topic '{0}'", desc)
          let! tdesc = Async.FromBeginEnd(desc.Path, beginCreate, nm.EndCreateTopic)
          return! first_create ()
        with | :? MessagingEntityAlreadyExistsException -> return! then_create_subscription () }
    and then_create_subscription ()  : Async<SubscriptionDescription> =
      async {
        let beginCreate = nm.BeginCreateSubscription : string * string * AsyncCallback * obj -> IAsyncResult
        return! Async.FromBeginEnd(desc.Path, subName, beginCreate, nm.EndCreateSubscription) }
    first_create ()

On line 5, it underlines then_create_subscription () : Async<SubscriptionDescription> stating:

Type mismatch. Expecting a Async<unit> but given a Async<SubscriptionDescription> The type ‘unit’ does not match the type ‘SubscriptionDescription‘

Exists looks like this:

  let exists (nm : NamespaceManager ) (desc : PathBasedEntity) = 
    async { return! Async.FromBeginEnd(desc.Path, nm.BeginTopicExists, nm.EndTopicExists) }

I want it to create the topic and then go on to create the subscription for it.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:36:04+00:00Added an answer on June 15, 2026 at 5:36 pm

    There needs to be an else branch after if, otherwise the if is a statement, not an expression. The else is not implicit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a beginner in asp, and I am having trouble with this code. I
I am having trouble getting my datasource linked to my repeater through this code
I am having trouble figuring out where my issue with this code is. My
I am having trouble moving this JLabel across this JPanel? I put the code
I am having trouble getting this invisibilityOfElementLocated() method to work. Here is the code
I found this snippet of code I am having trouble trying to find a
I'm having trouble figuring out how to implement the code from this answer. Android:
I am having trouble finding an answer to this. Consider the clipping code below:
I am having trouble copying text using zeroclipboard. This is my html code: <dl
I'm having some trouble understanding this piece of code that my professor used as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.