import * as H from "../../../../Hub";
import * as M from "../../../../Managed";
import * as Ensuring from "./ensuring";
import * as FromChunkHubManaged from "./fromChunkHubManaged";
/**
 * Creates a stream from a subscription to a hub in the context of a managed
 * effect. The managed effect describes subscribing to receive messages from
 * the hub while the stream describes taking messages from the hub.
 *
 * The hub will be shut down once the stream is closed.
 */

export function fromChunkHubManagedWithShutdown(hub) {
  return M.map_(FromChunkHubManaged.fromChunkHubManaged(hub), Ensuring.ensuring(H.shutdown(hub)));
}
//# sourceMappingURL=fromChunkHubManagedWithShutdown.js.map