在另一个可观察的<object>中返回observable <void>

时间:2017-08-29 09:36:38

标签: javascript asynchronous observable

我是08-29 14:19:25.968 1661-1706/system_process I/ActivityManager: Killing 3494:com.android.gallery3d/u0a47 (adj 906): empty #17 08-29 14:19:26.058 1661-2063/system_process D/ActivityManager: cleanUpApplicationRecord -- 3494 08-29 14:19:26.100 1396-1428/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 716474 , only wrote 716400 08-29 14:19:26.176 4160-4332/com.example.geqwe1.ankle D/NetworkSecurityConfig: No Network Security Config specified, using platform default 08-29 14:19:26.541 4160-4167/com.example.geqwe1.ankle W/art: Suspending all threads took: 7.465ms 08-29 14:19:26.939 4160-4332/com.example.geqwe1.ankle W/System.err: javax.net.ssl.SSLHandshakeException: Handshake failed 08-29 14:19:26.941 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:429) 08-29 14:19:26.946 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.okhttp.Connection.connectTls(Connection.java:235) 08-29 14:19:26.955 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.okhttp.Connection.connectSocket(Connection.java:199) 08-29 14:19:26.956 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.okhttp.Connection.connect(Connection.java:172) 08-29 14:19:26.956 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.okhttp.Connection.connectAndSetOwner(Connection.java:367) 08-29 14:19:26.956 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:130) 08-29 14:19:26.957 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:329) 08-29 14:19:26.957 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:246) 08-29 14:19:26.957 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:457) 08-29 14:19:26.957 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:126) 08-29 14:19:26.958 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:257) 08-29 14:19:26.958 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218) 08-29 14:19:26.958 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java) 08-29 14:19:26.961 4160-4332/com.example.geqwe1.ankle W/System.err: at com.example.geqwe1.ankle.RegisterActivity$BackGround.doInBackground(RegisterActivity.java:55) 08-29 14:19:26.961 4160-4332/com.example.geqwe1.ankle W/System.err: at com.example.geqwe1.ankle.RegisterActivity$BackGround.doInBackground(RegisterActivity.java:40) 08-29 14:19:26.961 4160-4332/com.example.geqwe1.ankle W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:305) 08-29 14:19:26.961 4160-4332/com.example.geqwe1.ankle W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237) 08-29 14:19:26.962 4160-4332/com.example.geqwe1.ankle W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243) 08-29 14:19:26.968 4160-4332/com.example.geqwe1.ankle W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 08-29 14:19:26.971 4160-4332/com.example.geqwe1.ankle W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 08-29 14:19:26.971 4160-4332/com.example.geqwe1.ankle W/System.err: at java.lang.Thread.run(Thread.java:761) 08-29 14:19:26.972 4160-4332/com.example.geqwe1.ankle W/System.err: Suppressed: javax.net.ssl.SSLHandshakeException: Handshake failed 08-29 14:19:26.972 4160-4332/com.example.geqwe1.ankle W/System.err: ... 21 more 08-29 14:19:26.973 4160-4332/com.example.geqwe1.ankle W/System.err: Suppressed: javax.net.ssl.SSLHandshakeException: Handshake failed 08-29 14:19:26.991 4160-4332/com.example.geqwe1.ankle W/System.err: ... 21 more 08-29 14:19:26.994 4160-4332/com.example.geqwe1.ankle W/System.err: Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xa7220b40: Failure in SSL library, usually a protocol error 08-29 14:19:26.997 4160-4332/com.example.geqwe1.ankle W/System.err: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER (external/boringssl/src/ssl/tls_record.c:192 0xa4179196:0x00000000) 08-29 14:19:26.998 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method) 08-29 14:19:26.998 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:357) 08-29 14:19:26.998 4160-4332/com.example.geqwe1.ankle W/System.err: ... 20 more 08-29 14:19:27.000 4160-4332/com.example.geqwe1.ankle W/System.err: Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xa7220b40: Failure in SSL library, usually a protocol error 08-29 14:19:27.002 4160-4332/com.example.geqwe1.ankle W/System.err: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER (external/boringssl/src/ssl/tls_record.c:192 0xa4179196:0x00000000) 08-29 14:19:27.002 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method) 08-29 14:19:27.002 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:357) 08-29 14:19:27.002 4160-4332/com.example.geqwe1.ankle W/System.err: ... 20 more 08-29 14:19:27.003 4160-4332/com.example.geqwe1.ankle W/System.err: Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xa7220b40: Failure in SSL library, usually a protocol error 08-29 14:19:27.003 4160-4332/com.example.geqwe1.ankle W/System.err: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER (external/boringssl/src/ssl/tls_record.c:192 0xa4179196:0x00000000) 08-29 14:19:27.003 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method) 08-29 14:19:27.003 4160-4332/com.example.geqwe1.ankle W/System.err: at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:357) 08-29 14:19:27.004 4160-4332/com.example.geqwe1.ankle W/System.err: ... 20 more 08-29 14:19:27.107 4160-4196/com.example.geqwe1.ankle D/EGL_emulation: eglMakeCurrent: 0xa5fd4e80: ver 3 1 (tinfo 0xa5fcc970) 08-29 14:19:27.126 4160-4196/com.example.geqwe1.ankle E/OpenGLRenderer: Corrupted GPU pixel buffer 08-29 14:19:27.175 2630-4350/com.google.android.gms W/DriveInitializer: Background init thread started 08-29 14:19:27.189 4160-4196/com.example.geqwe1.ankle D/EGL_emulation: eglMakeCurrent: 0xa5fd4e80: ver 3 1 (tinfo 0xa5fcc970) 08-29 14:19:27.689 2630-4350/com.google.android.gms W/DriveInitializer: Background init thread ended 08-29 14:19:29.327 1396-1429/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 1023969 , only wrote 871200 08-29 14:19:30.524 1661-1661/system_process W/WindowManager: Attempted to remove non-existing token: android.os.Binder@91c59c0 08-29 14:19:45.011 1883-2706/com.android.phone I/OmtpVvmCarrierCfgHlpr: OmtpEvent:CONFIG_STATUS_SMS_TIME_OUT 08-29 14:19:45.011 1883-1883/com.android.phone I/RetryPolicy: discarding deferred status: configuration_state=4 08-29 14:19:45.013 1883-1883/com.android.phone D/VvmTaskScheduler: No more tasks, stopping service if no task are added in 5000 millis 08-29 14:19:45.014 1883-1883/com.android.phone D/VvmTaskScheduler: create task:com.android.phone.vvm.omtp.ActivationTask 08-29 14:19:45.014 1883-1883/com.android.phone D/RetryPolicy: retry #2 for com.android.phone.vvm.omtp.ActivationTask@a95c13 queued, executing in 5000 08-29 14:19:45.016 1883-1883/com.android.phone D/VvmTaskScheduler: minimal wait time:4998 08-29 14:19:45.018 1883-1883/com.android.phone D/VvmTaskScheduler: minimal wait time:4996 08-29 14:19:50.017 1883-2706/com.android.phone V/VvmTaskScheduler: executing task com.android.phone.vvm.omtp.ActivationTask@a95c13 08-29 14:19:50.037 1883-2706/com.android.phone I/VvmActivationTask: VVM content provider configured - vvm_type_cvvm 08-29 14:19:50.037 1883-2706/com.android.phone I/OmtpVvmCarrierCfgHlpr: OmtpEvent:CONFIG_ACTIVATING 08-29 14:19:50.057 1883-2706/com.android.phone V/OmtpMessageSender: Sending BINARY sms 'Activate:dt=15' to 122:1808 08-29 14:19:50.072 1883-1883/com.android.phone D/VvmStatusSmsFetcher: Request SMS successfully sent 08-29 14:20:00.025 1762-2002/com.android.systemui E/OpenGLRenderer: Corrupted GPU pixel buffer 08-29 14:20:05.652 3194-3309/com.google.android.talk I/Babel_ConcService: Acquired partial wake lock to keep ConcurrentService alive 08-29 14:20:05.653 3194-3309/com.google.android.talk I/Babel_ConcService: Released partial wake lock as ConcurrentService became idle 的新手,有一个返回observables的parentMethod, 在这个方法中我必须调用一个返回Observable<void>的childMethod,在我得到responseObject之后我应该发一个http请求并返回Observable<responseObject>,执行的调用和顺序很重要,类似下面的代码语法错误。我该怎么想?我该怎么做?

Observable<void>

1 个答案:

答案 0 :(得分:0)

我刚刚写了@Bergi的建议。

public childMethod(): Observable<someObject>{
    return //....
} 
public parentMethod(): Observable<void> {
    return childMethod() // has error because it returns observable<someObject>
        .flatMap((response)=>{
            return http.post(url, response as someobject) // I want to return this
        })
}